GHA fix syntax error 2. #3
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: Upload Rust Packages | ||
on: | ||
release: | ||
types: [published] | ||
permissions: | ||
contents: write | ||
jobs: | ||
upload-binkplayer: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
build: [linux, windows, mac] | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
exec: binkplayer | ||
platform: x86_64-linux | ||
- build: macos | ||
os: macos-latest | ||
exec: binkplayer | ||
platform: x86_64-macos | ||
- build: windows | ||
os: windows-latest | ||
exec: binkplayer.exe | ||
platform: x86_64-windows | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Build package | ||
run: | | ||
cargo build | ||
- name: Upload binkplayer to Github release | ||
run: | | ||
staging="binkplayer-${{github.event.release.tag_name}}-${{ matrix.platform }}" | ||
mkdir "$staging" | ||
cp target/release/${{ matrix.exec }} "$staging/" | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
7z a "$staging.zip" "$staging" | ||
gh release upload ${{github.event.release.tag_name}} "$staging.zip" | ||
else | ||
tar czf "$staging.tar.gz" "$staging" | ||
gh release upload ${{github.event.release.tag_name}} "$staging.tar.gz" | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ github.TOKEN }} | ||
shell: bash | ||
publish: | ||
name: Publish package in crates.io | ||
runs-on: ubuntu-latest | ||
run: | | ||
cargo publish -p bladeink --token ${CRATES_TOKEN} | ||
cargo publish -p binkplayer --token ${CRATES_TOKEN} | ||
env: | ||
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} |