forked from coral-xyz/anchor
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 2.51 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
91
92
93
94
95
96
97
98
name: Publish a release
on:
push:
tags:
- "*"
permissions:
contents: write
env:
CROSS_VERSION: 0.2.5
jobs:
release-linux:
name: Release (Linux)
runs-on: buildjet-32vcpu-ubuntu-2004
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Install cross
uses: supplypike/setup-bin@v3
with:
uri: "https://github.com/cross-rs/cross/releases/download/v${{ env.CROSS_VERSION }}/cross-x86_64-unknown-linux-musl.tar.gz"
name: "cross"
version: "${{ env.CROSS_VERSION }}"
- name: Build (Linux amd64)
run: |
cargo clean
cross build --release --target x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-musl/release/anchor \
anchor-linux-amd64
- name: Build (Linux arm64)
run: |
cargo clean
cross build --release --target aarch64-unknown-linux-musl
cp target/aarch64-unknown-linux-musl/release/anchor \
anchor-linux-arm64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.PAT_TOKEN }}
files: |
anchor-linux-amd64
anchor-linux-arm64
release-macos:
name: Release (macOS)
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Install Rust aarch64-apple-darwin target
run: |
rustup target add aarch64-apple-darwin
- name: Build (macOS amd64)
run: |
cargo build --release --target x86_64-apple-darwin
cp target/x86_64-apple-darwin/release/anchor \
anchor-macos-amd64
- name: Build (macOS arm64)
run: |
cargo build --release --target aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/anchor \
anchor-macos-arm64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.PAT_TOKEN }}
files: |
anchor-macos-amd64
anchor-macos-arm64