-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (85 loc) · 2.43 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
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-release:
strategy:
fail-fast: true
matrix:
include:
- build: x86_64-linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: aarch64-linux
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- build: x86_64-macos
os: macos-latest
target: x86_64-apple-darwin
- build: aarch64-macos
os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Rust
uses: dtolnay/[email protected]
with:
targets: ${{ matrix.target }}
- name: Install dependencies
if: matrix.build == 'aarch64-linux'
run: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "26.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Get tag id
id: get-tag
uses: iawia002/get-tag-or-commit-id@v1
- name: Build release binary
run: cargo build --target ${{ matrix.target }} --release
- name: Build archive
shell: bash
run: |
bins=(wackerd wacker)
for name in "${bins[@]}"; do
file="$name-${{ steps.get-tag.outputs.id }}-${{ matrix.build }}.tar.gz"
tar czf $file -C "target/${{ matrix.target }}/release" $name
echo "$name=$file" >> $GITHUB_ENV
done
- name: Upload release archive
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.wackerd }}
${{ env.wacker }}
publish:
needs: build-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Rust
uses: dtolnay/[email protected]
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "26.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: cargo publish
run: |
cargo publish -p wacker
cargo publish -p wacker-daemon
cargo publish -p wacker-cli
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}