Skip to content

Commit 7fe98f6

Browse files
committed
github release workflow to tag on push to main
1 parent 8cd2614 commit 7fe98f6

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Determine tag
19+
id: tag
20+
run: |
21+
base="v$(date -u +%Y.%m.%d)"
22+
existing=$(git tag -l "${base}*" | wc -l | tr -d ' ')
23+
if [ "$existing" -eq 0 ]; then
24+
echo "tag=${base}" >> "$GITHUB_OUTPUT"
25+
else
26+
echo "tag=${base}.${existing}" >> "$GITHUB_OUTPUT"
27+
fi
28+
29+
- name: Create release
30+
env:
31+
GH_TOKEN: ${{ github.token }}
32+
run: gh release create "${{ steps.tag.outputs.tag }}" --generate-notes

0 commit comments

Comments
 (0)