Skip to content

Commit 4689595

Browse files
committed
add release workflow
1 parent 42a3eb4 commit 4689595

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
on:
2+
push:
3+
branch:
4+
main
5+
6+
jobs:
7+
release:
8+
if: startsWith(github.event.head_commit.message, 'v')
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Get commit version and body
15+
id: commit
16+
run: |
17+
full_msg="${{ github.event.head_commit.message }}"
18+
version_num="$(echo "$full_msg" | head -n1)"
19+
body="$(echo "$full_msg" | tail -n +2)"
20+
21+
{
22+
echo "version_num<<EOF"
23+
echo "${version_num:1}"
24+
echo "EOF"
25+
} >> "$GITHUB_OUTPUT"
26+
27+
{
28+
echo "body<<EOF"
29+
echo "$body"
30+
echo "EOF"
31+
} >> "$GITHUB_OUTPUT"
32+
33+
- name: Setup Rust + UV
34+
uses: ./.github/actions/setup
35+
36+
- name: Publish to crates.io
37+
run: cargo publish
38+
env:
39+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
40+
41+
- name: Publish to PyPi
42+
run: maturin publish
43+
44+
- name: Create new repo release
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
body: |
48+
Patch release fixing cargo builds, faulty versions have been yanked
49+
50+
[crates.io release](https://crates.io/crates/skyblock-repo/${{ steps.commit.outputs.version_num }})
51+
[PyPi release](https://pypi.org/project/skyblock-repo/${{ steps.commit.outputs.version_num }})
52+
53+
Add to your project:
54+
55+
```sh
56+
cargo add skyblock-repo@=${{ steps.commit.outputs.version_num }}
57+
```
58+
```
59+
pip install skyblock-repo==${{ steps.commit.outputs.version_num }}
60+
```
61+
62+
${{ steps.commit.outputs.body }}

0 commit comments

Comments
 (0)