Skip to content

Commit 30c15df

Browse files
Update publish workflow (#515)
* Update publish workflow * removed unneccessary steps
1 parent 9e436a0 commit 30c15df

3 files changed

Lines changed: 40 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

44
name: CI
5-
permissions:
6-
contents: write
7-
pull-requests: write
5+
86
on:
97
push:
108
branches:
@@ -16,14 +14,10 @@ on:
1614

1715
jobs:
1816
build:
19-
2017
runs-on: ubuntu-latest
21-
2218
strategy:
2319
matrix:
24-
node-version:
25-
- 20.x
26-
- 22.x
20+
node-version: [20, 22]
2721

2822
steps:
2923
- uses: actions/checkout@v6
@@ -36,7 +30,7 @@ jobs:
3630
- run: npm test
3731
- run: npm run build --if-present
3832
- name: Save build
39-
if: matrix.node-version == '20.x'
33+
if: matrix.node-version == 20
4034
uses: actions/upload-artifact@v6
4135
with:
4236
name: build
@@ -60,39 +54,47 @@ jobs:
6054
npm-publish-build:
6155
needs: build
6256
runs-on: ubuntu-latest
57+
permissions:
58+
id-token: write
59+
contents: read
6360
steps:
6461
- uses: actions/download-artifact@v7
6562
with:
6663
name: build
6764
- uses: actions/setup-node@v6
6865
with:
69-
node-version: 20.x
66+
node-version: 20
67+
registry-url: 'https://registry.npmjs.org'
68+
- name: Update npm to latest (required for OIDC)
69+
run: npm install -g npm@latest
7070
- uses: rlespinasse/github-slug-action@v3.x
7171
- name: Append commit hash to package version
7272
run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
7373
- name: Disable pre- and post-publish actions
7474
run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
75-
- uses: JS-DevTools/npm-publish@v4.1.4
75+
- name: Publish to npm
7676
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
77-
with:
78-
token: ${{ secrets.NPM_TOKEN }}
79-
tag: ${{ env.GITHUB_REF_SLUG }}
77+
run: npm publish --tag ${{ env.GITHUB_REF_SLUG }}
8078

8179
npm-publish-latest:
8280
needs: [build, npm-publish-build]
8381
runs-on: ubuntu-latest
8482
if: github.ref == 'refs/heads/main'
83+
permissions:
84+
id-token: write # Required for OIDC
85+
contents: read
8586
steps:
8687
- uses: actions/download-artifact@v7
8788
with:
8889
name: build
8990
- uses: actions/setup-node@v6
9091
with:
91-
node-version: 20.x
92+
node-version: 20
93+
registry-url: 'https://registry.npmjs.org'
94+
- name: Update npm to latest (required for OIDC)
95+
run: npm install -g npm@latest
9296
- name: Disable pre- and post-publish actions
9397
run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
94-
- uses: JS-DevTools/npm-publish@v4.1.4
98+
- name: Publish to npm
9599
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
96-
with:
97-
token: ${{ secrets.NPM_TOKEN }}
98-
tag: latest
100+
run: npm publish --tag latest

package-lock.json

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"repository": {
3636
"type": "git",
37-
"url": "git+https://github.com/solidos/solid-panes.git"
37+
"url": "git+https://github.com/SolidOS/solid-panes.git"
3838
},
3939
"keywords": [
4040
"solid",

0 commit comments

Comments
 (0)