-
Notifications
You must be signed in to change notification settings - Fork 10
103 lines (83 loc) · 2.8 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
99
100
101
102
103
name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create GitHub release
uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
upload-binaries:
strategy:
matrix:
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
# Try to complete every job in the matrix, even if one fails.
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: cross
# This installs protobuf on the host (runner)
# This is not needed for cross-compiled targets, however there is no
# way to check the architecture of the current runner, so this just always
# runs.
- name: Install Protobuf
uses: ./.github/actions/install-protobuf
# Run the build & upload artifacts
- name: Build and upload lading binaries
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: lading
no_default_features: true
target: ${{ matrix.target }}
checksum: sha256
token: ${{ secrets.GITHUB_TOKEN }}
# Auth for the S3 upload
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.LADING_RELEASE_BOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.LADING_RELEASE_BOT_SECRET_ACCESS_KEY }}
aws-region: us-west-2
# Copy from cargo target directory to S3 release bucket
- name: Upload binary to S3
run: |
aws s3 cp target/${{ matrix.target }}/release/lading s3://lading-releases/${{ github.ref_name }}/${{ matrix.target }}/lading
crates-io-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install protobuf
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Publish to crates.io
run: |
cargo publish \
--token ${{ secrets.CARGO_REGISTRY_TOKEN }} \
--locked \
--package lading-capture
cargo publish \
--token ${{ secrets.CARGO_REGISTRY_TOKEN }} \
--locked \
--package lading