name: Release
permissions:
contents: write
on:
workflow_call:
inputs:
tag:
required: true
type: string
env:
CARGO_TERM_COLOR: always
jobs:
upload-assets:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
ref: refs/tags/${{ inputs.tag }}
- name: Import codesign certs
if: startsWith(matrix.os, 'macos')
uses: apple-actions/import-codesign-certs@63fff01cd422d4b7b855d40ca1e9d34d2de9427d with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASS }}
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@b8d1a322a6009a2b7220f53996695778eef89b41 with:
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 with:
shared-key: rust-${{ matrix.target }}
- name: Upload binary (macOS signed)
if: startsWith(matrix.os, 'macos')
uses: taiki-e/upload-rust-binary-action@f391289bcff6a7f36b6301c0a74199657bbb4561 with:
bin: communique
target: ${{ matrix.target }}
ref: refs/tags/${{ inputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
codesign: "Developer ID Application: Jeffrey Dickey (4993Y37DX6)"
codesign_prefix: dev.jdx.
- name: Upload binary (non-macOS)
if: ${{ !startsWith(matrix.os, 'macos') }}
uses: taiki-e/upload-rust-binary-action@f391289bcff6a7f36b6301c0a74199657bbb4561 with:
bin: communique
target: ${{ matrix.target }}
ref: refs/tags/${{ inputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}