Create artifacts #17
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow | |
name: Create artifacts | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
create-linux-artifacts: | |
name: Create Linux artifacts | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-24.04] | |
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu] | |
arch: [x64, arm64] | |
exclude: | |
- os: ubuntu-24.04 | |
target: x86_64-unknown-linux-gnu | |
arch: arm64 | |
- os: ubuntu-24.04 | |
target: aarch64-unknown-linux-gnu | |
arch: x64 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
- name: Install targets | |
shell: bash | |
run: | | |
rustup target add x86_64-unknown-linux-gnu | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Install cargo-binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Install cargo cross | |
shell: bash | |
run: | | |
cargo binstall --no-confirm --force cross; | |
- name: Build | |
shell: bash | |
env: | |
FEDIPROTOSYNC_INCLUDE_COMMIT_HASH: "${{ github.event_name == 'workflow_dispatch' || 'false' }}" | |
FEDIPROTOSYNC_UPDATE_MANIFEST_VERSION: "true" | |
run: | | |
cross build --target "${{ matrix.target }}" --release; | |
mkdir -p "${{ github.workspace }}/artifacts/linux-${{ matrix.arch }}"; | |
cp "${{ github.workspace }}/target/${{ matrix.target }}/release/fediproto-sync" "${{ github.workspace }}/artifacts/linux-${{ matrix.arch }}/fediproto-sync"; | |
- name: Create artifact (Linux - x64) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "fediproto-sync_linux-${{ matrix.arch }}_${{ github.ref_type == 'tag' && github.ref_name || github.sha }}" | |
path: ${{ github.workspace }}/artifacts/linux-${{ matrix.arch }}/**/* | |
if-no-files-found: error |