docs: update README to clarify supported formats and their variations #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create NPM package | |
on: | |
push: | |
jobs: | |
run-tests: | |
# only run if specific '#build' tag is found in commit message | |
if: contains(github.event.head_commit.message, '#build') | |
name: "Run tests" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@openaip" | |
# IMPORTANT use "npm install" to also include dev-dependencies which are required for running tests | |
- run: npm install | |
name: Install packages | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}} | |
- run: npm run test | |
publish: | |
name: "Build and publish package" | |
needs: run-tests | |
runs-on: ubuntu-22.04 | |
steps: | |
# IMPORTANT initiates another checkout which essentially resets the working directory | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@openaip" | |
# IMPORTANT building requires dev-dependencies to be installed | |
- run: npm install | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}} | |
- run: npm run build | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}} | |
- id: bump-version | |
uses: phips28/gh-action-bump-version@master | |
name: Bump package version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
major-wording: "#build-major" | |
minor-wording: "#build-minor" | |
patch-wording: "#build-patch" | |
# use "patch" as default bump strategy | |
default: patch | |
tag-prefix: "v" | |
- uses: actions/create-release@v1 | |
name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{steps.bump-version.outputs.newTag}} | |
release_name: Release ${{steps.bump-version.outputs.newTag}} | |
body: | | |
Various fixes and performance improvements. | |
draft: false | |
prerelease: false | |
- run: npm publish | |
name: Publish to GitHub Package Registry | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GHPR_NPM_TOKEN}} | |
permissions: | |
contents: write |