diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index 400ccdb..277ca81 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -22,11 +22,6 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: "Retrieve NPM Token" id: vault uses: hashicorp/vault-action@v2.4.3 @@ -39,33 +34,26 @@ jobs: secrets: | secret/data/github/github_packages_write GITHUB_PACKAGES_WRITE_TOKEN | GITHUB_PACKAGES_WRITE_TOKEN ; github/token/integration-frontend-toolkit-semantic-release token | GITHUB_TOKEN ; + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: "https://npm.pkg.github.com" + scope: '@contentful' - - name: "Create GH .npmrc" - shell: bash - run: | - echo -e "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}\n@contentful:registry=https://npm.pkg.github.com\nalways-auth=true" > .npmrc - env: - GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }} - - - name: Install dependencies - run: npm ci + - run: npm ci env: GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }} - - name: Build - run: npm run build + - run: npm run build - name: Test run: npm test - - name: Release - shell: bash - run: | - echo -e "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}\n@contentful:registry=https://npm.pkg.github.com\nalways-auth=true" > .npmrc - cat .npmrc + - run: | npx semantic-release env: GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }} NPM_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }} - GH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }} NODE_AUTH_TOKEN: ${{ steps.vault.outputs.GITHUB_PACKAGES_WRITE_TOKEN }}