Skip to content

Commit b478af7

Browse files
author
Alain Bourgeois
committed
merge main
2 parents ee7b9e1 + b0c2ac7 commit b478af7

2 files changed

Lines changed: 252 additions & 255 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
name: build
7878
- uses: actions/setup-node@v6
7979
with:
80-
node-version: 22
80+
node-version: 20 # for npm@latest
8181
registry-url: 'https://registry.npmjs.org'
8282
- name: Update npm to latest (required for OIDC)
8383
run: npm install -g npm@latest
@@ -86,4 +86,32 @@ jobs:
8686
- name: Publish to npm
8787
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
8888
run: npm publish --tag latest
89+
90+
github-release:
91+
needs: [npm-publish-latest]
92+
runs-on: ubuntu-latest
93+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
94+
permissions:
95+
contents: write
96+
steps:
97+
- uses: actions/checkout@v6
98+
with:
99+
fetch-depth: 0
100+
- name: Create GitHub release with generated notes
101+
env:
102+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
run: |
104+
TAG="v$(node -p 'require("./package.json").version')"
105+
106+
if gh release view "$TAG" >/dev/null 2>&1; then
107+
echo "Release $TAG already exists. Skipping."
108+
exit 0
109+
fi
89110

111+
if git ls-remote --exit-code --tags origin "refs/tags/$TAG" >/dev/null 2>&1; then
112+
echo "Tag $TAG already exists on origin. Creating release from existing tag."
113+
gh release create "$TAG" --verify-tag --generate-notes
114+
else
115+
echo "Creating tag and release $TAG from commit $GITHUB_SHA."
116+
gh release create "$TAG" --target "$GITHUB_SHA" --generate-notes
117+
fi

0 commit comments

Comments
 (0)