Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 70 additions & 5 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,79 @@ on:
- "v*.*.*-rc*"

jobs:
release:
runs-on: ubuntu-latest
build:
strategy:
fail-fast: false
matrix:
platform:
- os-name: Linux-x86_64
runs-on: ubuntu-latest
target: x86_64-unknown-linux-musl

- os-name: Linux-aarch64
runs-on: ubuntu-latest
target: aarch64-unknown-linux-musl

- os-name: macOS-x86_64
runs-on: macOS-latest
target: x86_64-apple-darwin

- os-name: macOS-aarch64
runs-on: macOS-latest
target: aarch64-apple-darwin

- os-name: Windows-x86_64
runs-on: windows-latest
target: x86_64-pc-windows-msvc

name: Build - ${{ matrix.platform.os-name }}
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build
uses: houseabsolute/actions-rust-cross@a8cc74d61047fa553b4e908b4b10e70029f00ca6 # v1.0.6
with:
command: build
target: ${{ matrix.platform.target }}
args: "--release"
- name: Compress
shell: bash
run: | #bash
VERSION=${GITHUB_REF#refs/tags/}
TARGET=${{ matrix.platform.target }}
ASSET="rustic-exporter-$VERSION-$TARGET"

mkdir -p "$ASSET"
if [[ $TARGET == *"windows"* ]]; then
cp target/$TARGET/release/rustic-exporter.exe "$ASSET"
else
cp target/$TARGET/release/rustic-exporter "$ASSET"
fi

tar -czf "${ASSET}.tar.gz" "${ASSET}"

- name: Create Release
- name: Collect Artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
path: "*.tar.gz"
name: assets-${{ matrix.platform.target }}
overwrite: true

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: assets-*
path: ./dist
merge-multiple: true

- name: Publish
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
files: ./dist/*.tar.gz