-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 2.23 KB
/
create-artifacts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# 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: ubuntu-latest
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu]
arch: [x64, arm64]
exclude:
- os: ubuntu-latest
target: [x86_64-unknown-linux-gnu]
arch: [arm64]
- os: ubuntu-latest
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