From 73edaa3e31f736943bcaca0e41bbec8e45f818f4 Mon Sep 17 00:00:00 2001 From: Sven65 Date: Tue, 10 Sep 2024 11:58:05 +0200 Subject: [PATCH] Update package and release --- .github/workflows/release.yml | 11 +++++++++++ package.json | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba28dc0..4ee20ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,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: @@ -52,6 +59,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/zip-release@0.7.5 if: ${{ hashFiles('dist/') != '' }} diff --git a/package.json b/package.json index 0aa64de..a1224ff 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "api-volunteer-manager-integration", + "name": "@helsingborg-stad/api-volunteer-manager-integration", "version": "3.0.3", "description": "Frontend integration for api-volunteer-manager.", "main": "", @@ -12,6 +12,9 @@ "bugs": { "url": "https://github.com/helsingborg-stad/api-volunteer-manager-integration/issues" }, + "files": [ + "dist/" + ], "homepage": "https://github.com/helsingborg-stad/api-volunteer-manager-integration", "devDependencies": { "@babel/core": "^7.18.10",