-
Notifications
You must be signed in to change notification settings - Fork 178
79 lines (64 loc) · 2 KB
/
bridge-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
name: Bridge Release
on:
workflow_dispatch:
workflow_run:
workflows:
- Mega Releaser
types:
- completed
env:
CARGO_TERM_COLOR: always
jobs:
release:
name: release x86_64-unknown-linux-gnu
runs-on: ubuntu-24.04
environment: release
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
extension: ""
- target: aarch64-apple-darwin
os: macos-latest
extension: ""
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Compile bridge
run: cargo build --release --manifest-path bridge/svix-bridge/Cargo.toml
- name: Release
uses: actions/upload-artifact@v3
with:
name: svix-bridge-x86_64-unknown-linux-gnu
path: bridge/target/release/svix-bridge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
name: release docker
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Login Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Derive Version Numbers
run: |
export REPO="${{ secrets.DOCKERHUB_USERNAME }}/svix-bridge"
echo DOCKER_TAGS="$(echo "${{ github.event.release.tag_name }}" | sed -E "s#v([0-9]+)\.([0-9]+)\.([0-9]+)#${REPO}:latest,${REPO}:v\1.\2.\3,${REPO}:v\1.\2,${REPO}:v\1#")" >> "$GITHUB_ENV"
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./bridge
file: ./bridge/Dockerfile
push: true
tags: ${{ env.DOCKER_TAGS }}
platforms: linux/amd64,linux/arm64