Skip to content

Commit

Permalink
#build-minor: update nodemon to version 3.1.9 and improve GitHub Acti…
Browse files Browse the repository at this point in the history
…ons workflow
  • Loading branch information
reskume committed Dec 30, 2024
1 parent 20be8b7 commit 69f8628
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 49 deletions.
98 changes: 57 additions & 41 deletions .github/workflows/github-create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,86 +6,102 @@ 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'
name: "Run tests"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# this is important to make sure that tokens are not reused in subsequent steps
# -> removeing this will cause the "GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}" to
- 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
- uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://npm.pkg.github.com/
scope: '@openaip'
- run: npm install
name: Install packages
env:
NODE_AUTH_TOKEN: ${{secrets.AUTOMATOR_DEVOPS_PAT}}
- run: npm run test
- 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:
name: 'Build and publish package'
permissions:
contents: write
name: "Publish package"
needs: run-tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# this is important to make sure that tokens are not reused in subsequent steps
# -> removeing this will cause the "GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}" to
- 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
- uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://npm.pkg.github.com/
scope: '@openaip'
- run: npm install
env:
NODE_AUTH_TOKEN: ${{secrets.AUTOMATOR_DEVOPS_PAT}}
- id: bump-version
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
name: Bump package version
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
with:
major-wording: '#build-major'
minor-wording: '#build-minor'
patch-wording: '#build-patch'
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
tag-prefix: "v"
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
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
# publish to GitHub Package Registry for internal use with @openaip namespace
- uses: actions/setup-node@v3
- 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'
- run: npm publish
name: Publish to GitHub Package Registry
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATOR_DEVOPS_PAT }}
- name: Publish to GitHub Package Registry
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.AUTOMATOR_DEVOPS_PAT}}
# publish to NPM for public access
- uses: actions/setup-node@v3
- 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'
- run: npm publish --access public
name: Publish to NPM Package Registry
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
permissions:
contents: write
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}}
14 changes: 7 additions & 7 deletions 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
Expand Up @@ -53,7 +53,7 @@
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-prettier": "^4.2.1",
"nodemon": "^3.1.7",
"nodemon": "^3.1.9",
"npm-check-updates": "^16.14.20",
"prettier": "^2.8.8",
"version-bump-prompt": "^6.1.0",
Expand Down

0 comments on commit 69f8628

Please sign in to comment.