diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc70d33e..240bde56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,13 +2,14 @@ name: v3.x releases on: push: + branches: + # Pushes to the branch below will test the release workflow without + # publishing version on npm or generating new git tags + - v3.x-test tags: - 'v3.[0-9]+.[0-9]+' - 'v3.[0-9]+.[0-9]+-alpha.[0-9]+' - 'v3.[0-9]+.[0-9]+-beta.[0-9]+' - # The "test" prerelease version exist solely to validate changes on the - # release workflow. This is intended to be published - - 'v3.[0-9]+.[0-9]+-test.[0-9]+' jobs: debug: @@ -71,6 +72,6 @@ jobs: path: ~/.npm # this is cache where npm installs from before going out to the network key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} - run: npm install --prefer-offline - - run: ./release + - run: ./bin/release env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/release b/bin/release similarity index 89% rename from release rename to bin/release index 4f563ce8..03919fcb 100755 --- a/release +++ b/bin/release @@ -3,7 +3,7 @@ # Get the git tag that triggered the workflow build workflow_version=${GITHUB_REF_NAME:1} # Removed the "v" prefix # Get version major being handled by the current workflow -workflow_major=$(echo $version | cut -d. -f1) +workflow_major=$(echo $workflow_version | cut -d. -f1) workflow_track="latest-v${workflow_major}.x" # Get latest version on npm registry @@ -13,7 +13,7 @@ latest_major=$(echo $latest_version | cut -d. -f1) # If it's a test prerelease, we just want to test the release workflow (dry run it!) -if [[ "$workflow_version" == *"-test."* ]]; then +if [[ "$workflow_version" == *"-test"* ]]; then npm publish --tag $workflow_track --dry-run && \ exit 0 fi diff --git a/package.json b/package.json index 691981ca..ad3e3637 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "url": "https://github.com/lquixada/cross-fetch/issues" }, "dependencies": { - "node-fetch": "^2.6.12" + "node-fetch": "^2.6.13" }, "devDependencies": { "@commitlint/cli": "12.0.1",