Skip to content

Commit 38b9d55

Browse files
authored
Add GitHub release on tag push, backfill existing releases
Add a release job to the publish workflow that builds a dist tarball and creates a GitHub release with auto-generated notes on every tag push. Backfill releases for all five existing version tags (v0.1.0, v0.2.0-alpha.1, v0.2.0, v0.3.0-alpha.1, v0.3.0). Closes #9
1 parent 511ebee commit 38b9d55

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,39 @@ jobs:
4141
echo "tag=latest" >> $GITHUB_OUTPUT
4242
fi
4343
- run: npm publish --provenance --access public --tag ${{ steps.tag.outputs.tag }}
44+
45+
release:
46+
needs: publish
47+
runs-on: ubuntu-latest
48+
permissions:
49+
contents: write
50+
steps:
51+
- uses: actions/checkout@v6
52+
- uses: actions/setup-node@v6
53+
with:
54+
node-version: "22.14"
55+
- run: npm ci
56+
- run: npm run build
57+
- name: Create tarball
58+
run: |
59+
VERSION="${{ github.ref_name }}"
60+
tar -czf "decree-typescript-${VERSION}.tar.gz" dist/
61+
- name: Determine if prerelease
62+
id: prerelease
63+
run: |
64+
VERSION="${{ github.ref_name }}"
65+
if echo "$VERSION" | grep -qE 'alpha|beta|rc'; then
66+
echo "flag=--prerelease" >> $GITHUB_OUTPUT
67+
else
68+
echo "flag=" >> $GITHUB_OUTPUT
69+
fi
70+
- name: Create GitHub release
71+
env:
72+
GH_TOKEN: ${{ github.token }}
73+
run: |
74+
TAG="${{ github.ref_name }}"
75+
gh release create "$TAG" \
76+
"decree-typescript-${TAG}.tar.gz" \
77+
--generate-notes \
78+
--title "Release ${TAG}" \
79+
${{ steps.prerelease.outputs.flag }}

0 commit comments

Comments
 (0)