v0.0.1 #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
release: | |
types: ["published"] | |
jobs: | |
release: | |
runs-on: ${{ matrix.platform == 'linux' && 'ubuntu-latest' || matrix.platform == 'windows' && 'ubuntu-latest' || matrix.platform == 'macos' && 'macos-latest' }} | |
strategy: | |
matrix: | |
platform: [linux, windows, macos] | |
fail-fast: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Linux (for linux and windows we can use the default make commands to build the binary) | |
- name: Build binary (linux/windows) | |
if: matrix.platform == 'linux' || matrix.platform == 'windows' | |
run: make dist-${{ matrix.platform }} | |
# Macos (for macos we need to use cachix to install nix and devenv and then use devenv to build the binary) | |
- uses: cachix/install-nix-action@v26 | |
if: matrix.platform == 'macos' | |
- uses: cachix/cachix-action@v14 | |
if: matrix.platform == 'macos' | |
with: | |
name: devenv | |
- name: Install devenv.sh | |
if: matrix.platform == 'macos' | |
run: nix profile install nixpkgs#devenv | |
- name: Build binary (macos) | |
if: matrix.platform == 'macos' | |
run: devenv shell make dist-macos | |
# Finalize | |
- name: Test binary | |
run: dist/${{ matrix.platform }}/schwifty "DE89370400440532013000" | |
- name: Compress binary | |
run: tar -czvf schwifty-${{ matrix.platform }}.tar.gz -C dist/${{ matrix.platform }}/ schwifty | |
- uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./schwifty-${{ matrix.platform }}.tar.gz | |
asset_name: schwifty-${{ matrix.platform }}.tar.gz | |
asset_content_type: application/gzip |