name: Upload release binaries
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Tag to build & upload binaries for (e.g. v0.1.1)"
required: true
type: string
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
upload-assets:
name: Upload ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: universal-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: rust-rapport
target: ${{ matrix.target }}
archive: $bin-$target
tar: unix
zip: windows
ref: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
refresh-demo:
name: Refresh demo PR
needs: upload-assets
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: demo/showcase
fetch-depth: 0
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
- name: Push empty refresh commit
env:
REF_NAME: ${{ github.ref_name }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit --allow-empty -m "chore: refresh demo for ${REF_NAME}"
git push origin demo/showcase