Skip to content

Commit 39690a1

Browse files
committed
fix(release): use node LTS
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 2d092a1 commit 39690a1

1 file changed

Lines changed: 5 additions & 32 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ on:
3434
- `next` - Prerelease or beta versions
3535
- `canary` - Canary/nightly builds
3636
37-
If omitted for a pushed Git tag, the workflow tries to reuse the Git tag
38-
as the npm dist-tag unless it looks like a version tag such as `v1.2.3`.
39-
4037
See https://docs.npmjs.com/adding-dist-tags-to-packages.
4138
type: string
4239
required: false
@@ -67,12 +64,13 @@ jobs:
6764
permissions:
6865
contents: read
6966
packages: write
70-
id-token: write # Required for provenance
67+
id-token: write # Required for provenance generation and publishing to registries that require authentication with an OIDC token
7168
steps:
7269
- name: Setup Node.js
7370
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7471
with:
7572
registry-url: ${{ inputs.registry-url }}
73+
node-version: "lts/*"
7674

7775
- name: Download package tarball
7876
id: download-package-tarball
@@ -134,11 +132,6 @@ jobs:
134132
PACKAGE_TARBALL_PATH: ${{ steps.package-tarball.outputs.path }}
135133
ACCESS: ${{ inputs.access }}
136134
TAG: ${{ inputs.tag }}
137-
GITHUB_EVENT_NAME: ${{ github.event_name }}
138-
GITHUB_EVENT_REF: ${{ github.event.ref }}
139-
GITHUB_REF: ${{ github.ref }}
140-
GITHUB_REF_NAME: ${{ github.ref_name }}
141-
GITHUB_REF_TYPE: ${{ github.ref_type }}
142135
PROVENANCE: ${{ inputs.provenance }}
143136
DRY_RUN: ${{ inputs.dry-run }}
144137
REGISTRY_URL: ${{ inputs.registry-url }}
@@ -147,32 +140,12 @@ jobs:
147140
const path = require('node:path');
148141
149142
const packageTarballPath = process.env.PACKAGE_TARBALL_PATH;
150-
const access = process.env.ACCESS.trim();
151-
const inputTag = process.env.TAG.trim();
152-
const eventName = process.env.GITHUB_EVENT_NAME ?? '';
153-
const eventRef = process.env.GITHUB_EVENT_REF ?? '';
154-
const gitRef = process.env.GITHUB_REF ?? '';
155-
const gitRefName = process.env.GITHUB_REF_NAME ?? '';
156-
const gitRefType = process.env.GITHUB_REF_TYPE ?? '';
157-
const registryUrl = process.env.REGISTRY_URL;
143+
const access = process.env.ACCESS?.trim();
144+
const tag = process.env.TAG?.trim();
145+
const registryUrl = process.env.REGISTRY_URL ?? '';
158146
const dryRun = process.env.DRY_RUN === 'true';
159147
const provenance = process.env.PROVENANCE === 'true';
160148
161-
let tag = inputTag;
162-
163-
if (!tag) {
164-
const isPushTagEvent = eventName === 'push' && gitRefType === 'tag' && gitRef.startsWith('refs/tags/');
165-
const hasPushTagRef = eventRef.startsWith('refs/tags/');
166-
const canReuseGitTag = gitRefName && !/^(?:v)?\d/.test(gitRefName);
167-
168-
if ((isPushTagEvent || hasPushTagRef) && canReuseGitTag) {
169-
tag = gitRefName;
170-
core.info(`No npm dist-tag input provided. Using Git tag "${tag}" as npm dist-tag.`);
171-
} else if ((isPushTagEvent || hasPushTagRef) && gitRefName) {
172-
core.info(`No npm dist-tag input provided. Git tag "${gitRefName}" looks like a version tag, so npm will use its default dist-tag.`);
173-
}
174-
}
175-
176149
const args = ['publish', packageTarballPath];
177150
178151
if (access) {

0 commit comments

Comments
 (0)