-
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (69 loc) · 2.47 KB
/
deploy.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
77
78
79
80
81
82
name: CD
on:
release:
types: [published]
permissions:
contents: write
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
jobs:
upload-assets:
strategy:
fail-fast: false
matrix:
include:
- { os: macos-latest, target: aarch64-apple-darwin }
- { os: macos-latest, target: universal-apple-darwin }
- { os: macos-latest, target: x86_64-apple-darwin }
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu }
- { os: ubuntu-latest, target: aarch64-unknown-linux-musl }
- { os: ubuntu-latest, target: x86_64-unknown-freebsd }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
- { os: windows-latest, target: aarch64-pc-windows-msvc }
- { os: windows-latest, target: x86_64-pc-windows-msvc }
name: Deploy (${{ matrix.target }})
runs-on: ${{ matrix.os }}
if: github.repository_owner == 'robjtede' && startsWith(github.event.release.name, 'v')
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
with:
cache: false
# TODO: see if this is needed after next deploy
# - if: startsWith(matrix.os, 'ubuntu') && !endsWith(matrix.target, '-musl')
- uses: taiki-e/setup-cross-toolchain-action@v1.28.0
with:
target: ${{ matrix.target }}
# TODO: see if this is needed after next deploy
# - if: endsWith(matrix.target, '-musl')
# uses: taiki-e/install-action@v2.23.1
# with:
# tool: cross
# TODO: see if this is needed after next deploy
# - if: endsWith(matrix.target, 'windows-msvc')
# run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
- name: Build and upload to release
id: upload-release
uses: taiki-e/upload-rust-binary-action@v1.24.0
with:
bin: protobug
target: ${{ matrix.target }}
tar: all
zip: all
checksum: sha256,sha512
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: ${{ steps.upload-release.outputs.zip }}