Skip to content

Commit

Permalink
feat:add release CI (#101)
Browse files Browse the repository at this point in the history
* add release CI

* fixex
  • Loading branch information
ltitanb committed Sep 3, 2024
1 parent fbbb8a7 commit afb98ce
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 67 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/docker-publish.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Draft Release

on:
push:
tags:
- "v*"

env:
BINARY_NAME: commit-boost

permissions:
contents: write
packages: write

jobs:
create-draft-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push PBS Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/commit-boost/pbs:${{ github.ref_name }}
ghcr.io/commit-boost/pbs:latest
cache-from: type=gha
cache-to: type=gha,mode=max
file: docker/pbs.Dockerfile

- name: Build and push Signer Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/commit-boost/signer:${{ github.ref_name }}
ghcr.io/commit-boost/signer:latest
cache-from: type=gha
cache-to: type=gha,mode=max
file: docker/pbs.Dockerfile

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Build Linux binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target x86_64-unknown-linux-gnu --bin ${{ env.BINARY_NAME }}

- name: Rename binary
run: |
mv target/x86_64-unknown-linux-gnu/release/${{ env.BINARY_NAME }} ${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-amd64
- name: Create Draft Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
draft: true
prerelease: false
files: ${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-amd64

0 comments on commit afb98ce

Please sign in to comment.