diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 17764a7..3d43e8e 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -172,14 +172,6 @@ jobs: name: npm-module path: newrelic-native-metrics-${{ env.PKG_VERSION }}.tgz - test_var: - runs-on: ubuntu-latest - steps: - - run: echo "not a dry run" - if: ${{ inputs.dry_run == false }} - - run: echo "is a dry run" - if: ${{ inputs.dry_run == true }} - # Our typical flow looks like: # 1. prepare-release workflow # 2. create-release workflow @@ -190,53 +182,53 @@ jobs: # # Given that, we need to replicate all of our create-release steps inline # here. -# tag_release: -# if: ${{ input.dry_run == false }} -# needs: [ package ] -# runs-on: ubuntu-latest -# name: Tag Release -# steps: -# - uses: actions/checkout@v4 -# # We need access to the prep scripts in the node-newrelic repo. -# - uses: actions/checkout@v4 -# with: -# repository: newrelic/node-newrelic -# path: agent-repo -# - uses: actions/setup-node@v4 -# - run: | -# # Install agent-repo dependencies. -# npm ci --prefix agent-repo -# - name: Configure GitHub Credentials -# run: | -# git config user.name ${GITHUB_ACTOR} -# git config user.email gh-actions-${GITHUB_ACTOR}@github.com -# - name: Create Release Tag -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# run: | -# node ./agent-repo/bin/create-release-tag.js --branch ${{ github.ref }} --repo ${{ github.repository }} --workflows test.yml,prepare-release.yml -# - name: Get Created Tag -# id: get_tag -# run: echo "latest_tag=$(git describe --tags --abbrev=0)" >> ${GITHUB_OUTPUT} -# - name: Create GitHub Release -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# run: | -# node ./agent-repo/bin/create-github-release.js --tag ${{ steps.get_tag.outputs.latest_tag }} --repo ${{ github.repository }} --changelog ${{ inputs.changelog_file }} -# -# publish: -# if: ${{ input.dry_run == false }} -# needs: [ tag_release ] -# runs-on: ubuntu-latest -# name: Publish Package -# steps: -# - uses: actions/setup-node@v4 -# with: -# registry-url: 'https://registry.npmjs.org' -# - uses: actions/download-artifact@v4 -# with: -# name: npm-module -# - run: echo -e "PKG_NAME=$(ls -1A *.tgz | head -n 1)" >> "$GITHUB_ENV" -# - run: npm publish --access=public ${PKG_NAME} -# env: -# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + tag_release: + if: ${{ inputs.dry_run == false }} + needs: [ package ] + runs-on: ubuntu-latest + name: Tag Release + steps: + - uses: actions/checkout@v4 + # We need access to the prep scripts in the node-newrelic repo. + - uses: actions/checkout@v4 + with: + repository: newrelic/node-newrelic + path: agent-repo + - uses: actions/setup-node@v4 + - run: | + # Install agent-repo dependencies. + npm ci --prefix agent-repo + - name: Configure GitHub Credentials + run: | + git config user.name ${GITHUB_ACTOR} + git config user.email gh-actions-${GITHUB_ACTOR}@github.com + - name: Create Release Tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + node ./agent-repo/bin/create-release-tag.js --branch ${{ github.ref }} --repo ${{ github.repository }} --workflows test.yml,prepare-release.yml + - name: Get Created Tag + id: get_tag + run: echo "latest_tag=$(git describe --tags --abbrev=0)" >> ${GITHUB_OUTPUT} + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + node ./agent-repo/bin/create-github-release.js --tag ${{ steps.get_tag.outputs.latest_tag }} --repo ${{ github.repository }} --changelog ${{ inputs.changelog_file }} + + publish: + if: ${{ inputs.dry_run == false }} + needs: [ tag_release ] + runs-on: ubuntu-latest + name: Publish Package + steps: + - uses: actions/setup-node@v4 + with: + registry-url: 'https://registry.npmjs.org' + - uses: actions/download-artifact@v4 + with: + name: npm-module + - run: echo -e "PKG_NAME=$(ls -1A *.tgz | head -n 1)" >> "$GITHUB_ENV" + - run: npm publish --access=public ${PKG_NAME} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 4a38cb7..bf5c837 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "native": "node tests/native/*.js", "test": "npm run unit && npm run integration", "install": "node-gyp-build", - "prepare": "husky install", + "prepare": "husky install || true", "third-party-updates": "oss third-party manifest && oss third-party notices && git add THIRD_PARTY_NOTICES.md third_party_manifest.json" }, "repository": {