Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ on:
push:
branches: [ main ]

# Never run two publishes at once; a second merge waits for the first to finish
concurrency:
group: publish-to-npm
cancel-in-progress: false

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.author.email, 'hello@openactive.io')"
# Loop guard: the version bump commit below is pushed by the OpenActive GitHub App, and also carries [skip ci]
if: ${{ github.actor != 'openactive[bot]' }}

steps:
- name: Generate GitHub App Token
Expand All @@ -24,20 +33,21 @@ jobs:
run: |
git config --global user.name "openactive[bot]"
git config --global user.email 207210293+openactive[bot]@users.noreply.github.com
- name: Use Node.js 14.x
uses: actions/setup-node@v1
- name: Use Node.js 18.17.1
uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18.17.1
registry-url: https://registry.npmjs.org/
- name: Install
run: npm ci
- name: Test
run: npm test
- name: Increment Version
run: npm version patch
run: npm version patch -m "%s [skip ci]"
# Push before publishing: if the push is rejected, nothing is published, so npm can never get ahead of GitHub
- name: Push version update
run: git push origin HEAD:main
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Push version update
run: git push
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN2 }}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openactive/models-ts",
"version": "1.0.3",
"version": "1.0.4",
"description": "JavaScript/TypeScript implementation of OpenActive's data model",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down
Loading