Skip to content

Commit

Permalink
ci: Build binaries on release
Browse files Browse the repository at this point in the history
  • Loading branch information
malthesr committed Aug 29, 2023
1 parent d89553c commit 2ab91cb
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: release
on:
release:
types: [created]

env:
NAME: sfs

jobs:
release_assets:
name: Release
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, target: x86_64-unknown-linux-gnu}
- {os: macos-latest, target: x86_64-apple-darwin}
- {os: windows-latest, target: x86_64-pc-windows-msvc}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build
run: cargo build --release --target ${{ matrix.config.target }}
- name: Archive (Unix)
if: matrix.config.os != 'windows-latest'
run: tar czf ${{ env.NAME }}-${{ matrix.config.target }}.tar.gz -C ./target/${{ matrix.config.target }}/release/ ${{ env.NAME }}
- name: Archive (Windows)
if: matrix.config.os == 'windows-latest'
run: compress-archive ./target/${{ matrix.config.target }}/release/${{ env.NAME }}.exe ${{ env.NAME }}-${{ matrix.config.target }}.zip
- name: Upload
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.NAME }}-${{ matrix.config.target }}.*
asset_name: ${{ env.NAME }}-${{ matrix.config.target }}
tag: ${{ github.ref }}
file_glob: true
overwrite: true

0 comments on commit 2ab91cb

Please sign in to comment.