From 3f79235a108e4400fafdfe51466a73d76873c181 Mon Sep 17 00:00:00 2001 From: Sven65 Date: Tue, 10 Sep 2024 13:27:06 +0200 Subject: [PATCH] Update package and release --- .github/workflows/release.yml | 20 ++++++++++++++------ package-lock.json | 9 +++++---- package.json | 11 ++++++----- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94a9ff2..923e4d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -32,6 +35,13 @@ 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: @@ -43,15 +53,13 @@ jobs: - name: Run CI if: ${{ hashFiles('package.json') != '' && hashFiles('package-lock.json') != '' }} run: npm ci --no-progress --no-audit - - name: Run install - if: ${{ hashFiles('package.json') != '' && hashFiles('package-lock.json') == '' }} - run: npm install --no-progress --no-audit - name: Run build if: ${{ hashFiles('package-lock.json') != '' && hashFiles('gulp.js') == '' }} run: npx --yes browserslist@latest --update-db && npm run build - - 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/zip-release@0.7.5 if: ${{ hashFiles('dist/') != '' }} diff --git a/package-lock.json b/package-lock.json index a64f613..4267a8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2954,9 +2954,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001603", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001603.tgz", - "integrity": "sha512-iL2iSS0eDILMb9n5yKQoTBim9jMZ0Yrk8g0N9K7UzYyWnfIKzXBZD5ngpM37ZcL/cv0Mli8XtVMRYMQAfFpi5Q==", + "version": "1.0.30001660", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001660.tgz", + "integrity": "sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==", "dev": true, "funding": [ { @@ -2971,7 +2971,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chalk": { "version": "2.4.2", diff --git a/package.json b/package.json index e3926c2..73ad213 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "CustomerFeedback", + "name": "@helsingborg-stad/customerfeedback", "version": "4.0.8", "description": "Puts a customer feedback form on each page", "main": "", @@ -10,18 +10,19 @@ }, "repository": { "type": "git", - "url": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate.git" + "url": "https://github.com/helsingborg-stad/customer-feedback.git" }, "author": "Kristoffer Svanmark", "license": "MIT", "bugs": { - "url": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate/issues" + "url": "https://github.com/helsingborg-stad/customer-feedback/issues" }, - "homepage": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate", + "homepage": "https://github.com/helsingborg-stad/customer-feedback", "browserslist": [ "> 1%", "not dead" ], + "files": ["dist/"], "devDependencies": { "@babel/core": "^7.17.2", "@babel/plugin-proposal-class-properties": "^7.16.7", @@ -55,4 +56,4 @@ "webpack-merge": "^4.2.1", "webpack-remove-empty-scripts": "^0.7.3" } -} \ No newline at end of file +}