Skip to content

Release

Release #1

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
release:
name: Release - ${{ matrix.platform.release_for }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- release_for: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- release_for: macOS-Intel
os: macos-12
target: x86_64-apple-darwin
- release_for: macOS-ARM
os: macos-latest
target: aarch64-apple-darwin
- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.platform.target }}
- name: Build
run: cargo build -p rere --verbose --release --target ${{ matrix.platform.target }}
- name: Rename binary
run: |
cd target/${{ matrix.platform.target }}/release
mv rere${{ matrix.platform.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }} rere-${{ matrix.platform.release_for }}${{ matrix.platform.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}
- name: Generate SHA256 checksum
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then
powershell -Command "(Get-FileHash rere-${{ matrix.platform.release_for }}.exe -Algorithm SHA256).Hash.ToLower() + ' rere-${{ matrix.platform.release_for }}.exe'" > rere-${{ matrix.platform.release_for }}.sha256
elif [[ "${{ matrix.platform.os }}" == "macos-12" || "${{ matrix.platform.os }}" == "macos-latest" ]]; then
shasum -a 256 rere-${{ matrix.platform.release_for }} > rere-${{ matrix.platform.release_for }}.sha256
else
sha256sum rere-${{ matrix.platform.release_for }} > rere-${{ matrix.platform.release_for }}.sha256
fi
- name: Upload SHA256 checksum
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
./target/${{ matrix.platform.target }}/release/rere-${{ matrix.platform.release_for }}.sha256
- name: Upload Release Asset (Binary)
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
./target/${{ matrix.platform.target }}/release/rere-${{ matrix.platform.release_for }}${{ matrix.platform.target == 'x86_64-pc-windows-msvc' && '.exe' || '' }}