This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
90 lines (86 loc) · 3.21 KB
/
release.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
83
84
85
86
87
88
89
90
name: Release
on:
push:
branches: [master, release/*]
jobs:
release-linux-binaries:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-20.04
strategy:
matrix:
target: [x86_64-unknown-linux-musl, aarch64-unknown-linux-musl]
include:
- target: x86_64-unknown-linux-musl
docker_image: registry.gitlab.com/rust_musl_docker/image:stable-latest
docker_options: -v /home/runner/work/heartwood/heartwood:/workdir -v /home/runner/.cargo/git:/root/.cargo/git -v /home/runner/.cargo/registry:/root/.cargo/registry
- target: aarch64-unknown-linux-musl
docker_image: messense/rust-musl-cross:aarch64-musl
docker_options: -v /home/runner/work/heartwood/heartwood:/home/rust/src -v /home/runner/.cargo/git:/root/.cargo/git -v /home/runner/.cargo/registry:/root/.cargo/registry
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Get tags
run: git fetch --prune --unshallow --tags origin
- name: Configure build cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
- name: Build the binaries
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.docker_image }}
options: ${{ matrix.docker_options }}
run: .github/workflows/build.bash "${{ matrix.target }}"
- name: Build the debug binaries
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.docker_image }}
options: ${{ matrix.docker_options }}
run: .github/workflows/build-debug.bash "${{ matrix.target }}"
- run: .github/workflows/upload.bash "${{ matrix.target }}" "${{ github.sha }}"
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
release-macos-binaries:
permissions:
contents: 'read'
id-token: 'write'
runs-on: macos-11
strategy:
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: Get tags
run: git fetch --prune --unshallow --tags origin
- name: Configure build cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
- name: Build the release binaries
run: .github/workflows/build.bash "${{ matrix.target }}"
- name: Build the debug binaries
run: .github/workflows/build-debug.bash "${{ matrix.target }}"
- run: .github/workflows/upload.bash "${{ matrix.target }}" "${{ github.sha }}"
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
update-latest-symlink:
needs: [release-linux-binaries, release-macos-binaries]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- run: .github/workflows/update-latest-symlink.sh "${{ github.sha }}"
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}