Skip to content

Commit b5e2126

Browse files
authored
Merge pull request #23 from JLarky/feat-more-npm-publish-stuff
fix lint errors, upload artifact of the publish step
2 parents 6bf5065 + 8aba7b3 commit b5e2126

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/publish-npm.generated.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@ jobs:
2525
uses: actions/checkout@v5
2626
- name: Install mise
2727
uses: jdx/mise-action@v3
28-
- run: "mkdir -p \"$RUNNER_TEMP/out\""
2928
- name: Publish package
3029
env:
3130
NPM_CONFIG_PROVENANCE: "true"
32-
run: "mise run clone-to-npm --publish --ci -d \"$RUNNER_TEMP/out\" --skip-publish"
31+
run: "mise run clone-to-npm --publish --ci -d \"$RUNNER_TEMP\" --skip-publish"
3332
- run: pwd && ls -la
34-
working-directory: /home/runner/work/_temp/out/npm
33+
working-directory: "${{ runner.temp }}/npm"
3534
- uses: actions/setup-node@v4
3635
with:
3736
node-version: 22
3837
registry-url: https://registry.npmjs.org
3938
- run: "export NPM_CONFIG_PROVENANCE=true\nwhich node && node -v\nwhich npm && npm -v\nnpm publish --provenance"
40-
working-directory: /home/runner/work/_temp/out/npm
39+
working-directory: "${{ runner.temp }}/npm"
40+
- uses: actions/upload-artifact@v4
41+
if: "${{ always() }}"
42+
with:
43+
name: "npm-package-${{ steps.version.outputs.version }}"
44+
path: "${{ runner.temp }}/npm"
45+
retention-days: 3

.github/workflows/publish-npm.main.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@ echo "version=\${VERSION}" >> "$GITHUB_OUTPUT"`,
3333
run: `echo "Hello world! Publishing version \${{ steps.version.outputs.version }}"`,
3434
},
3535
...checkoutAndInstallMise(),
36-
{ run: `mkdir -p "$RUNNER_TEMP/out"` },
3736
{
3837
name: "Publish package",
3938
env: {
4039
NPM_CONFIG_PROVENANCE: "true",
4140
},
42-
run: `mise run clone-to-npm --publish --ci -d "$RUNNER_TEMP/out" --skip-publish`,
41+
run: `mise run clone-to-npm --publish --ci -d "$RUNNER_TEMP" --skip-publish`,
4342
},
4443
{
4544
run: "pwd && ls -la",
46-
"working-directory": "/home/runner/work/_temp/out/npm",
45+
"working-directory": "${{ runner.temp }}/npm",
4746
},
4847
{
4948
uses: "actions/setup-node@v4",
@@ -59,7 +58,16 @@ echo "version=\${VERSION}" >> "$GITHUB_OUTPUT"`,
5958
"which npm && npm -v",
6059
"npm publish --provenance",
6160
].join("\n"),
62-
"working-directory": "/home/runner/work/_temp/out/npm",
61+
"working-directory": "${{ runner.temp }}/npm",
62+
},
63+
{
64+
uses: "actions/upload-artifact@v4",
65+
if: "${{ always() }}",
66+
with: {
67+
name: "npm-package-${{ steps.version.outputs.version }}",
68+
path: "${{ runner.temp }}/npm",
69+
"retention-days": 3,
70+
},
6371
},
6472
],
6573
},

0 commit comments

Comments
 (0)