Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

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 64ce2eb commit 2da6a38
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,29 @@ jobs:
build-assets:
needs: ['release']
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get latest release version
id: get-version
run: |
echo "LATEST_RELEASE=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')" >> $GITHUB_ENV
- 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: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 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: Setup node
uses: actions/setup-node@v3
with:
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
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "project-manager-integration",
"name": "@helsingborg-stad/project-manager-integration",
"version": "2.0.5",
"description": "Imports and displays projects from Project Manager API.",
"main": "",
Expand All @@ -19,6 +19,9 @@
"build:dev": "cross-env NODE_ENV=development webpack",
"build": "cross-env NODE_ENV=production webpack"
},
"files": [
"dist/"
],
"browserslist": [
"> 1%",
"not dead"
Expand Down

0 comments on commit 2da6a38

Please sign in to comment.