Skip to content

Commit 1b2e6dc

Browse files
wherka-amaWaldek Herka
andauthored
fix(ci): bump the version of the @prompt-registry/collection-scripts and improving the package publication flow (#188)
Co-authored-by: Waldek Herka <waldek.herka@no.reply>
1 parent 6fc99fa commit 1b2e6dc

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

.github/workflows/lib-collection-scripts-ci.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ name: Collection Scripts Library CI
22

33
on:
44
push:
5-
branches: [main, develop]
5+
branches: [main]
66
paths:
77
- "lib/**"
88
pull_request:
9-
branches: [main, develop]
9+
branches: [main]
1010
paths:
1111
- "lib/**"
1212
workflow_dispatch:
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: false
17+
1418
env:
1519
NODE_VERSION: "20"
1620

@@ -86,15 +90,10 @@ jobs:
8690
# Check if this version tag already exists
8791
if git tag -l "collection-scripts-v$PACKAGE_VERSION" | grep -q .; then
8892
echo "exists=true" >> $GITHUB_OUTPUT
93+
echo "Version $PACKAGE_VERSION already published"
8994
else
9095
echo "exists=false" >> $GITHUB_OUTPUT
9196
fi
92-
93-
- name: Publish package
94-
if: steps.version-check.outputs.exists == 'false'
95-
run: npm publish --provenance --access public
96-
env:
97-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9897
- name: Create version tag
9998
if: steps.version-check.outputs.exists == 'false'
10099
run: |
@@ -104,8 +103,10 @@ jobs:
104103
git push origin "collection-scripts-v${{ steps.version-check.outputs.version }}"
105104
env:
106105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107-
108-
- name: Skip publish (version exists)
109-
if: steps.version-check.outputs.exists == 'true'
106+
- name: Publish package
107+
if: steps.version-check.outputs.exists == 'false'
108+
run: npm publish --provenance --access public
109+
- name: Push the tag
110+
if: steps.version-check.outputs.exists == 'false'
110111
run: |
111-
echo "Version ${{ steps.version-check.outputs.version }} already published, skipping."
112+
git push origin "collection-scripts-v${{ steps.version-check.outputs.version }}"

lib/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ npm run build
126126
npm test
127127
```
128128

129+
### Releasing
130+
131+
The package is configured to use provenance signing for npm publish. Make sure to set up OIDC authentication if publishing to npm.
132+
The version is taken from the package.json file. Therefore it is important to bump the version before publishing
133+
134+
```bash
135+
npm version <patch|minor|major>
136+
```
137+
129138
## License
130139

131-
MIT
140+
Apache License Version 2.0

lib/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prompt-registry/collection-scripts",
3-
"version": "1.0.1",
3+
"version": "1.0.4",
44
"description": "Shared scripts for building, validating, and publishing Copilot prompt collections",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)