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 2c6a4b5 commit 17c06f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
17 changes: 14 additions & 3 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,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:
Expand All @@ -43,15 +53,16 @@ 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/') != '' }}
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "attachment-revisions",
"name": "@helsingborg-stad/attachment-revisions",
"version": "3.0.4",
"description": "Attachment revisions",
"main": "",
Expand All @@ -11,14 +11,15 @@
},
"repository": {
"type": "git",
"url": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate.git"
"url": "https://github.com/helsingborg-stad/attachment-revisions.git"
},
"author": "Kristoffer Svanmark",
"license": "MIT",
"bugs": {
"url": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate/issues"
"url": "https://github.com/helsingborg-stad/attachment-revisions/issues"
},
"homepage": "https://github.com/Svanmark/Wordpress-Plugin-Boilerplate",
"files": ["dist/"],
"homepage": "https://github.com/helsingborg-stad/attachment-revisions",
"browserslist": [
"> 1%",
"not dead",
Expand Down

0 comments on commit 17c06f3

Please sign in to comment.