Skip to content

Commit 3b23507

Browse files
committed
Update release & package
1 parent c0ce7b7 commit 3b23507

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/workflows/release.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
build-assets:
2424
needs: ['release']
2525
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
packages: write
2629
steps:
2730
- name: Get latest release version
2831
id: get-version
@@ -32,6 +35,13 @@ jobs:
3235
uses: actions/checkout@v4
3336
with:
3437
fetch-depth: 0
38+
- name: Update version in package.json
39+
run: |
40+
# Read the latest release version from environment variable
41+
LATEST_VERSION="${{ env.LATEST_RELEASE }}"
42+
43+
# Update the "version" field in package.json using jq
44+
jq --arg version "$LATEST_VERSION" '.version = $version' package.json > temp.json && mv temp.json package.json
3545
- name: Setup node
3646
uses: actions/setup-node@v3
3747
with:
@@ -43,15 +53,13 @@ jobs:
4353
- name: Run CI
4454
if: ${{ hashFiles('package.json') != '' && hashFiles('package-lock.json') != '' }}
4555
run: npm ci --no-progress --no-audit
46-
- name: Run install
47-
if: ${{ hashFiles('package.json') != '' && hashFiles('package-lock.json') == '' }}
48-
run: npm install --no-progress --no-audit
4956
- name: Run build
5057
if: ${{ hashFiles('package-lock.json') != '' && hashFiles('gulp.js') == '' }}
5158
run: npx --yes browserslist@latest --update-db && npm run build
52-
- name: Run gulp
53-
if: ${{ hashFiles('package-lock.json') != '' && hashFiles('gulp.js') != '' }}
54-
run: gulp
59+
- name: Publish npm package to GHCR
60+
run: npm publish --registry=https://npm.pkg.github.com
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5563
- name: Create assets zip
5664
uses: thedoctor0/zip-release@0.7.5
5765
if: ${{ hashFiles('dist/') != '' }}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "modularity-form-builder",
2+
"name": "@helsingborg-stad/modularity-form-builder",
33
"version": "3.2.3",
44
"description": "Formbuilder for modularity",
55
"main": "",
@@ -22,6 +22,7 @@
2222
"> 1%",
2323
"not dead"
2424
],
25+
"files": ["dist/"],
2526
"devDependencies": {
2627
"@babel/core": "^7.17.2",
2728
"@babel/plugin-proposal-class-properties": "^7.16.7",

0 commit comments

Comments
 (0)