Skip to content

Commit

Permalink
Update package and release
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven65 committed Sep 10, 2024
1 parent 071b6be commit 3a26a2e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
build-assets:
needs: ['release']
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get latest release version
id: get-version
Expand All @@ -32,10 +35,21 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update version in package.json
run: |
# Read the latest release version from environment variable
LATEST_VERSION="${{ env.LATEST_RELEASE }}"
# Update the "version" field in package.json using jq
jq --arg version "$LATEST_VERSION" '.version = $version' package.json > temp.json && mv temp.json package.json
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20.6.0
- name: Inject access token in .npmrc
run: |
echo "registry=https://npm.pkg.github.com/helsingborg-stad" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
- name: Run CI
if: ${{ hashFiles('package.json') != '' && hashFiles('package-lock.json') != '' }}
run: npm ci --no-progress --no-audit
Expand All @@ -48,6 +62,10 @@ jobs:
- name: Run gulp
if: ${{ hashFiles('package-lock.json') != '' && hashFiles('gulp.js') != '' }}
run: gulp
- name: Publish npm package to GHCR
run: npm publish --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create assets zip
uses: thedoctor0/[email protected]
if: ${{ hashFiles('dist/') != '' }}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "api-alarm-integration",
"name": "@helsingborg-stad/api-alarm-integration",
"version": "4.0.5",
"description": "Shows alarms from API Alarm Manager",
"main": "",
Expand All @@ -13,6 +13,9 @@
"> 1%",
"not dead"
],
"files": [
"dist/"
],
"devDependencies": {
"@babel/core": "^7.17.2",
"@babel/plugin-proposal-class-properties": "^7.16.7",
Expand Down Expand Up @@ -66,12 +69,12 @@
},
"repository": {
"type": "git",
"url": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate.git"
"url": "https://github.com/helsingborg-stad/api-alarm-integration.git"
},
"author": "Kristoffer Svanmark",
"license": "MIT",
"bugs": {
"url": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate/issues"
"url": "https://github.com/helsingborg-stad/api-alarm-integration/issues"
},
"homepage": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate"
"homepage": "https://github.com/helsingborg-stad/api-alarm-integration"
}

0 comments on commit 3a26a2e

Please sign in to comment.