Skip to content

Commit 8534ebb

Browse files
committed
Try a release action
1 parent 0e11769 commit 8534ebb

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]{4}.[0-9]{2}.[0-9]+'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Extract version from tag
18+
id: version
19+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
20+
21+
- name: Validate tag format
22+
run: |
23+
if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]{4}\.[0-9]{2}\.[0-9]+$ ]]; then
24+
echo "Tag $GITHUB_REF_NAME doesn't match vYYYY.MM.N"
25+
exit 1
26+
fi
27+
28+
- name: Generate checksum
29+
run: sha256sum ffc.h > ffc.h.sha256
30+
31+
- name: Create GitHub Release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
name: ${{ steps.version.outputs.VERSION }}
35+
body: |
36+
## ${{ steps.version.outputs.VERSION }}
37+
38+
Drop `ffc.h` into your project and parse some floats or whatever
39+
40+
**Verify checksum:**
41+
```
42+
sha256sum -c ffc.h.sha256
43+
```
44+
files: |
45+
ffc.h
46+
ffc.h.sha256
47+
fail_on_unmatched_files: true

0 commit comments

Comments
 (0)