Skip to content

Commit afb98ce

Browse files
committed
feat:add release CI (#101)
* add release CI * fixex
1 parent fbbb8a7 commit afb98ce

File tree

2 files changed

+80
-67
lines changed

2 files changed

+80
-67
lines changed

.github/workflows/docker-publish.yml

-67
This file was deleted.

.github/workflows/draft-release.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Draft Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
env:
9+
BINARY_NAME: commit-boost
10+
11+
permissions:
12+
contents: write
13+
packages: write
14+
15+
jobs:
16+
create-draft-release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Login to GitHub Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push PBS Docker image
33+
uses: docker/build-push-action@v6
34+
with:
35+
context: .
36+
push: true
37+
tags: |
38+
ghcr.io/commit-boost/pbs:${{ github.ref_name }}
39+
ghcr.io/commit-boost/pbs:latest
40+
cache-from: type=gha
41+
cache-to: type=gha,mode=max
42+
file: docker/pbs.Dockerfile
43+
44+
- name: Build and push Signer Docker image
45+
uses: docker/build-push-action@v6
46+
with:
47+
context: .
48+
push: true
49+
tags: |
50+
ghcr.io/commit-boost/signer:${{ github.ref_name }}
51+
ghcr.io/commit-boost/signer:latest
52+
cache-from: type=gha
53+
cache-to: type=gha,mode=max
54+
file: docker/pbs.Dockerfile
55+
56+
- name: Set up Rust
57+
uses: actions-rs/toolchain@v1
58+
with:
59+
profile: minimal
60+
toolchain: stable
61+
override: true
62+
63+
- name: Build Linux binary
64+
uses: actions-rs/cargo@v1
65+
with:
66+
command: build
67+
args: --release --target x86_64-unknown-linux-gnu --bin ${{ env.BINARY_NAME }}
68+
69+
- name: Rename binary
70+
run: |
71+
mv target/x86_64-unknown-linux-gnu/release/${{ env.BINARY_NAME }} ${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-amd64
72+
73+
- name: Create Draft Release
74+
uses: softprops/action-gh-release@v2
75+
with:
76+
name: Release ${{ github.ref_name }}
77+
tag_name: ${{ github.ref_name }}
78+
draft: true
79+
prerelease: false
80+
files: ${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-amd64

0 commit comments

Comments
 (0)