From fd02bb46ebb6afd3bdb6c8f20179a8d70fb374d3 Mon Sep 17 00:00:00 2001 From: Justin Zhang Date: Fri, 5 Sep 2025 12:24:04 +0100 Subject: [PATCH] Publish on release to Gearset GitHub Packages --- .github/workflows/npm-publish.yml | 17 +++++++++++++---- package.json | 8 +++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index a8515b840..3fb79a9a2 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -3,10 +3,10 @@ name: Publish NPM on Release -# on: -# release: -# types: [published] -on: workflow_dispatch +on: + release: + types: [published] + workflow_dispatch: jobs: build: @@ -23,13 +23,22 @@ jobs: publish-npm: needs: build runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version-file: ./package.json registry-url: 'https://npm.pkg.github.com' + scope: '@gearset' - run: npm ci + - name: Set version to release tag + run: | + if [ ${{github.event_name == 'release'}} ]; then + npm --no-git-tag-version version ${{ github.event.release.tag_name }} + fi - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/package.json b/package.json index 73f34e17a..0f4725e10 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "mcdev", + "name": "@gearset/mcdev", "version": "8.1.0", "description": "Accenture Salesforce Marketing Cloud DevTools", "author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas", "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/Accenture/sfmc-devtools.git" + "url": "https://github.com/Gearset/sfmc-devtools.git" }, "homepage": "https://github.com/Accenture/sfmc-devtools/wiki", "bugs": { @@ -121,9 +121,7 @@ "fsevents": "*" }, "lint-staged": { - "*.js": [ - "eslint --fix" - ] + "*.js": ["eslint --fix"] }, "type": "module" }