Skip to content

Commit 6f55dbd

Browse files
committed
fix(release): recover v1 publishing with local actions
1 parent 4f5b4e8 commit 6f55dbd

29 files changed

Lines changed: 2575 additions & 244 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Upload verified release tarballs
2+
description: Upload the three verified tarballs using the Actions artifact service.
3+
inputs:
4+
name:
5+
description: Artifact name
6+
default: npm-release-tarballs
7+
path:
8+
description: Directory containing exactly three verified tarballs
9+
required: true
10+
outputs:
11+
artifact-id:
12+
description: Immutable artifact identifier
13+
artifact-digest:
14+
description: SHA-256 digest of the uploaded archive
15+
runs:
16+
using: node24
17+
main: index.mjs
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {
2+
ArtifactUploadError,
3+
runArtifactUploadAction,
4+
} from '../../../../scripts/ci/upload-artifact.mjs'
5+
6+
try {
7+
await runArtifactUploadAction()
8+
} catch (error) {
9+
const message =
10+
error instanceof ArtifactUploadError
11+
? error.message
12+
: 'Artifact upload failed. Where: release artifact action. Saw: an unexpected failure; wanted a completed upload. Fix: inspect runner access and retry the job.'
13+
process.stderr.write(`::error::${message}\n`)
14+
process.exitCode = 1
15+
}

‎.github/workflows/ci.yml‎

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,24 @@ jobs:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 10
1717
steps:
18-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19-
with:
20-
persist-credentials: false
18+
- name: Checkout source
19+
shell: bash
20+
env:
21+
CHECKOUT_REF: ${{ github.sha }}
22+
GITHUB_TOKEN: ${{ github.token }}
23+
SERVER_URL: ${{ github.server_url }}
24+
REPOSITORY: ${{ github.repository }}
25+
run: |
26+
set -euo pipefail
27+
git init -q
28+
git config --local advice.detachedHead false
29+
git remote add origin "${SERVER_URL}/${REPOSITORY}"
30+
AUTH_B64="$(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 | tr -d '\n')"
31+
export GIT_CONFIG_COUNT=1
32+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
33+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
34+
git fetch --no-tags --depth=1 origin "$CHECKOUT_REF"
35+
git checkout -q --detach FETCH_HEAD
2136
2237
- name: Install zizmor
2338
shell: bash
@@ -108,10 +123,11 @@ jobs:
108123
fi
109124
echo "$PNPM_DIR" >> "${GITHUB_PATH:-/dev/null}"
110125
111-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
112-
with:
113-
node-version: 25.9.0
114-
cache: pnpm
126+
- name: Install Node.js
127+
shell: bash
128+
env:
129+
NODE_VERSION: 25.9.0
130+
run: node scripts/ci/setup-node.mjs --version "$NODE_VERSION"
115131

116132
- name: Download sfw
117133
shell: bash
@@ -236,16 +252,33 @@ jobs:
236252
run: pnpm install --loglevel error
237253

238254
- name: Lint
239-
run: pnpm check:lint
255+
run: |
256+
pnpm run check:actions
257+
pnpm check:lint
240258
241259
typecheck:
242260
name: 🔍 Type Check
243261
runs-on: ubuntu-latest
244262
timeout-minutes: 10
245263
steps:
246-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
247-
with:
248-
persist-credentials: false
264+
- name: Checkout source
265+
shell: bash
266+
env:
267+
CHECKOUT_REF: ${{ github.sha }}
268+
GITHUB_TOKEN: ${{ github.token }}
269+
SERVER_URL: ${{ github.server_url }}
270+
REPOSITORY: ${{ github.repository }}
271+
run: |
272+
set -euo pipefail
273+
git init -q
274+
git config --local advice.detachedHead false
275+
git remote add origin "${SERVER_URL}/${REPOSITORY}"
276+
AUTH_B64="$(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 | tr -d '\n')"
277+
export GIT_CONFIG_COUNT=1
278+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
279+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
280+
git fetch --no-tags --depth=1 origin "$CHECKOUT_REF"
281+
git checkout -q --detach FETCH_HEAD
249282
250283
- name: Install pnpm
251284
shell: bash
@@ -284,10 +317,11 @@ jobs:
284317
fi
285318
echo "$PNPM_DIR" >> "${GITHUB_PATH:-/dev/null}"
286319
287-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
288-
with:
289-
node-version: 25.9.0
290-
cache: pnpm
320+
- name: Install Node.js
321+
shell: bash
322+
env:
323+
NODE_VERSION: 25.9.0
324+
run: node scripts/ci/setup-node.mjs --version "$NODE_VERSION"
291325

292326
- name: Download sfw
293327
shell: bash
@@ -425,9 +459,24 @@ jobs:
425459
node-version: [22, 24]
426460
os: [ubuntu-latest]
427461
steps:
428-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
429-
with:
430-
persist-credentials: false
462+
- name: Checkout source
463+
shell: bash
464+
env:
465+
CHECKOUT_REF: ${{ github.sha }}
466+
GITHUB_TOKEN: ${{ github.token }}
467+
SERVER_URL: ${{ github.server_url }}
468+
REPOSITORY: ${{ github.repository }}
469+
run: |
470+
set -euo pipefail
471+
git init -q
472+
git config --local advice.detachedHead false
473+
git remote add origin "${SERVER_URL}/${REPOSITORY}"
474+
AUTH_B64="$(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 | tr -d '\n')"
475+
export GIT_CONFIG_COUNT=1
476+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
477+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
478+
git fetch --no-tags --depth=1 origin "$CHECKOUT_REF"
479+
git checkout -q --detach FETCH_HEAD
431480
432481
- name: Install pnpm
433482
shell: bash
@@ -466,10 +515,11 @@ jobs:
466515
fi
467516
echo "$PNPM_DIR" >> "${GITHUB_PATH:-/dev/null}"
468517
469-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
470-
with:
471-
node-version: ${{ matrix.node-version }}
472-
cache: pnpm
518+
- name: Install Node.js
519+
shell: bash
520+
env:
521+
NODE_VERSION: ${{ matrix.node-version }}
522+
run: node scripts/ci/setup-node.mjs --version "$NODE_VERSION"
473523

474524
- name: Download sfw
475525
shell: bash

‎.github/workflows/e2e-tests.yml‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,24 @@ jobs:
2121
os: [ubuntu-latest]
2222
# os: [ubuntu-latest, windows-latest] - Windows tests disbaled (see project https://linear.app/socketdev/project/autofixes-windows-support-fc2f2a45f759)
2323
steps:
24-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25-
with:
26-
persist-credentials: false
24+
- name: Checkout source
25+
shell: bash
26+
env:
27+
CHECKOUT_REF: ${{ github.sha }}
28+
GITHUB_TOKEN: ${{ github.token }}
29+
SERVER_URL: ${{ github.server_url }}
30+
REPOSITORY: ${{ github.repository }}
31+
run: |
32+
set -euo pipefail
33+
git init -q
34+
git config --local advice.detachedHead false
35+
git remote add origin "${SERVER_URL}/${REPOSITORY}"
36+
AUTH_B64="$(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 | tr -d '\n')"
37+
export GIT_CONFIG_COUNT=1
38+
export GIT_CONFIG_KEY_0="http.${SERVER_URL}/.extraheader"
39+
export GIT_CONFIG_VALUE_0="AUTHORIZATION: basic ${AUTH_B64}"
40+
git fetch --no-tags --depth=1 origin "$CHECKOUT_REF"
41+
git checkout -q --detach FETCH_HEAD
2742
2843
- name: Install pnpm
2944
shell: bash
@@ -62,9 +77,11 @@ jobs:
6277
fi
6378
echo "$PNPM_DIR" >> "${GITHUB_PATH:-/dev/null}"
6479
65-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
66-
with:
67-
node-version: ${{ matrix.node-version }}
80+
- name: Install Node.js
81+
shell: bash
82+
env:
83+
NODE_VERSION: ${{ matrix.node-version }}
84+
run: node scripts/ci/setup-node.mjs --version "$NODE_VERSION"
6885

6986
- name: Download sfw-free
7087
shell: bash

0 commit comments

Comments
 (0)