Skip to content

Commit 1b46da1

Browse files
author
Alain Bourgeois
committed
merge main
2 parents d87995c + de1f23a commit 1b46da1

2 files changed

Lines changed: 228 additions & 229 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
name: build
7676
- uses: actions/setup-node@v6
7777
with:
78-
node-version: 22
78+
node-version: 20 # for npm@latest
7979
registry-url: 'https://registry.npmjs.org'
8080
- name: Update npm to latest (required for OIDC)
8181
run: npm install -g npm@latest
@@ -84,3 +84,32 @@ jobs:
8484
- name: Publish to npm
8585
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
8686
run: npm publish --tag latest
87+
88+
github-release:
89+
needs: [npm-publish-latest]
90+
runs-on: ubuntu-latest
91+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
92+
permissions:
93+
contents: write
94+
steps:
95+
- uses: actions/checkout@v6
96+
with:
97+
fetch-depth: 0
98+
- name: Create GitHub release with generated notes
99+
env:
100+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
run: |
102+
TAG="v$(node -p 'require("./package.json").version')"
103+
104+
if gh release view "$TAG" >/dev/null 2>&1; then
105+
echo "Release $TAG already exists. Skipping."
106+
exit 0
107+
fi
108+
109+
if git ls-remote --exit-code --tags origin "refs/tags/$TAG" >/dev/null 2>&1; then
110+
echo "Tag $TAG already exists on origin. Creating release from existing tag."
111+
gh release create "$TAG" --verify-tag --generate-notes
112+
else
113+
echo "Creating tag and release $TAG from commit $GITHUB_SHA."
114+
gh release create "$TAG" --target "$GITHUB_SHA" --generate-notes
115+
fi

0 commit comments

Comments
 (0)