-
Notifications
You must be signed in to change notification settings - Fork 10
executable file
·86 lines (84 loc) · 2.7 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
name: Release
on:
push:
branches-ignore:
- '**'
tags-ignore:
- 'v*.*.*'
- 'v*.*.*-*'
release:
types:
- released
- prereleased
jobs:
binary_linux_amd64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install Cargo Deps And Build Bridge API
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
sudo apt-get update && sudo apt-get install -y protobuf-compiler pkg-config
cargo build --profile maxperf -p bridge-api
mv target/maxperf/bridge-api target/maxperf/bridge-api-linux-amd64
pushd target/maxperf/
tar czf bridge-api-linux-amd64.tar.gz bridge-api-linux-amd64
popd
- uses: actions/upload-artifact@v4
with:
name: bridge-api-linux-amd64-binary
path: target/maxperf/bridge-api-linux-amd64.tar.gz
binary_publish:
needs: [binary_linux_amd64]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v4
with:
name: bridge-api-linux-amd64-binary
- name: Export Tag Var
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: Publish Binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.PAT_TOKEN }}
file: /home/runner/work/bridge-api/bridge-api/bridge-api*
release_name: ${{ steps.prepare.outputs.tag_name }}
tag: ${{ steps.prepare.outputs.tag_name }}
overwrite: true
file_glob: true
docker_build_push:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Export Tag Var
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push images
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: availj/bridge-api:${{ steps.prepare.outputs.tag_name }}
build-args: |
BUILD_PROFILE=release