Skip to content

Commit 40bb987

Browse files
authored
chore(cd): draft release pr action
1 parent f7b02fa commit 40bb987

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Draft Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
type: choice
8+
required: true
9+
description: 'Version number to bump'
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
permissions:
16+
contents: write
17+
issues: write
18+
pull-requests: write
19+
20+
jobs:
21+
publish-dry-run:
22+
name: "Runs cargo publish --dry-run"
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Rust
29+
uses: dtolnay/rust-toolchain@stable
30+
31+
- name: publish crate
32+
run: cargo publish --dry-run
33+
34+
release:
35+
name: Create Release
36+
needs: publish-dry-run
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v6
41+
42+
- name: Setup Rust
43+
uses: dtolnay/rust-toolchain@stable
44+
45+
- name: Setup Cargo Binstall
46+
uses: cargo-bins/cargo-binstall@main
47+
48+
- name: Install Rust Binaries
49+
run: |
50+
cargo binstall -y --force cargo-tag
51+
52+
- name: Bump Version
53+
run: |
54+
git config --global user.name 'github-actions[bot]'
55+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
56+
cd ./src/http-server
57+
echo "CRATE_VERSION=$(cargo tag --no-tag -p=v ${{ inputs.version }})" >> $GITHUB_ENV
58+
git checkout -b release/$CRATE_VERSION
59+
git push origin HEAD
60+
gh pr create --fill

0 commit comments

Comments
 (0)