Skip to content

ci: version bump to v0.7.1 #34

ci: version bump to v0.7.1

ci: version bump to v0.7.1 #34

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:
- name: Checkout Code
uses: actions/checkout@v4
# IMPORTANT this is important to make sure that tokens are not reused in subsequent steps
# -> removing this will cause the "GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}" to
# reuse the token from the previous step although defined otherwise
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Clear npm cache
run: npm cache clean --force
- name: Configure .npmrc
run: |
echo "${{secrets.NPMRC}}" >> ~/.npmrc
- name: Install packages
run: npm install
- name: Run tests
run: npm run test
publish:
permissions:
contents: write
name: "Publish package"
needs: run-tests
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
# IMPORTANT this is important to make sure that tokens are not reused in subsequent steps
# -> removing this will cause the "GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}" to
# reuse the token from the previous step although defined otherwise
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
- name: Clear npm cache
run: npm cache clean --force
- name: Configure .npmrc
run: |
echo "${{secrets.NPMRC}}" >> ~/.npmrc
- name: Install packages
run: npm install
- name: Bump package version
id: bump-version
uses: phips28/gh-action-bump-version@master
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
with:
major-wording: "#build-major"
minor-wording: "#build-minor"
patch-wording: "#build-patch"
# use "patch" as default bump strategy
default: patch
tag-prefix: "v"
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }} # 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
- name: Setup Node for publishing to GitHub Package Registry
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://npm.pkg.github.com/
scope: '@openaip'
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
- name: Publish to GitHub Package Registry
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.AUTOMATOR_DEVOPS_PAT}}
- name: Setup Node for publishing to NPM registry
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
scope: '@openaip'
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
- name: Publish to NPM Package Registry
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}