Skip to content

Commit 4aa9882

Browse files
committed
chore: saner release flow
1 parent b689c26 commit 4aa9882

File tree

2 files changed

+57
-72
lines changed

2 files changed

+57
-72
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release FFI Version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "New semver tag (e.g. v0.2.0)"
8+
required: true
9+
type: string
10+
11+
jobs:
12+
create-release:
13+
name: Tag and Release
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Git
25+
run: |
26+
git config user.name "github-actions[bot]"
27+
git config user.email "github-actions[bot]@users.noreply.github.com"
28+
29+
- name: Get latest tag
30+
id: latest_tag
31+
run: |
32+
TAG=$(git describe --tags --abbrev=0 || echo "")
33+
echo "latest_tag=$TAG" >> "$GITHUB_OUTPUT"
34+
35+
- name: Create annotated tag
36+
run: |
37+
git tag -a "${{ inputs.tag }}" -m "Release ${{ inputs.tag }}"
38+
git push origin "${{ inputs.tag }}"
39+
40+
- name: Generate changelog
41+
id: changelog
42+
run: |
43+
if [ -z "${{ steps.latest_tag.outputs.latest_tag }}" ]; then
44+
git log --oneline > full_changelog.txt
45+
else
46+
git log --oneline "${{ steps.latest_tag.outputs.latest_tag }}"..HEAD > full_changelog.txt
47+
fi
48+
echo 'changelog<<EOF' >> $GITHUB_OUTPUT
49+
cat full_changelog.txt >> $GITHUB_OUTPUT
50+
echo 'EOF' >> $GITHUB_OUTPUT
51+
52+
- name: Create GitHub release
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
tag_name: ${{ inputs.tag }}
56+
name: Release ${{ inputs.tag }}
57+
body: ${{ steps.changelog.outputs.changelog }}

.github/workflows/release-plz.yaml

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)