-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (61 loc) · 1.94 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (61 loc) · 1.94 KB
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
name: release
# On a `vX.Y.Z` tag: attach a static Linux binary to a GitHub Release and push a container image to
# GHCR. (CI in ci.yml already gated fmt/clippy/tests on the way to main.)
on:
push:
tags: ["v*"]
permissions:
contents: write # create the GitHub Release
packages: write # push to ghcr.io
jobs:
crate:
name: Publish Rust crate
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Verify package
run: cargo publish --locked --dry-run
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: cargo publish --locked
binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
- run: sudo apt-get update && sudo apt-get install -y musl-tools
- run: cargo build --release --bin sentry --target x86_64-unknown-linux-musl
- run: install -D target/x86_64-unknown-linux-musl/release/sentry a3s-sentry-x86_64-linux
- uses: softprops/action-gh-release@v2
with:
files: a3s-sentry-x86_64-linux
generate_release_notes: true
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/a3s-lab/sentry
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}