Skip to content

Blade Ink v1.0.4

Blade Ink v1.0.4 #11

Workflow file for this run

name: Upload Rust Packages
on:
release:
types: [published]
permissions:
contents: write
jobs:
upload-binkplayer:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, windows, macos]
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 --release
- 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 packages in crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Publish
run: |
cargo publish -p bladeink --token ${CRATES_TOKEN}
cargo publish -p binkplayer --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}