-
Notifications
You must be signed in to change notification settings - Fork 41
Updated publish workflow #665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b4f3648
0211d5d
345e6d4
89316f2
431ffb1
0ef8639
3f95448
b85ed31
e7dfc3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,5 @@ | ||||||||||||||||||||
| name: CI | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| contents: write | ||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| push: | ||||||||||||||||||||
| branches: | ||||||||||||||||||||
|
|
@@ -11,14 +9,16 @@ on: | |||||||||||||||||||
| - main | ||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| id-token: write # Required for OIDC | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| build: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| strategy: | ||||||||||||||||||||
| matrix: | ||||||||||||||||||||
| node-version: | ||||||||||||||||||||
| - 20.x | ||||||||||||||||||||
| - 22.x | ||||||||||||||||||||
| node-version: [20, 22, 24] | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe SolidOS currently supports node 24 |
||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||
| - name: Use Node.js ${{ matrix.node-version }} | ||||||||||||||||||||
|
|
@@ -30,7 +30,7 @@ jobs: | |||||||||||||||||||
| - run: npm run build | ||||||||||||||||||||
| - run: npm run doc | ||||||||||||||||||||
| - name: Save build | ||||||||||||||||||||
| if: matrix.node-version == '20.x' | ||||||||||||||||||||
| if: matrix.node-version == 20 | ||||||||||||||||||||
| uses: actions/upload-artifact@v6 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| name: build | ||||||||||||||||||||
|
|
@@ -67,39 +67,63 @@ jobs: | |||||||||||||||||||
| npm-publish-build: | ||||||||||||||||||||
| needs: build | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| id-token: write # Required for OIDC | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/download-artifact@v7 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| name: build | ||||||||||||||||||||
| - uses: actions/setup-node@v6 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: 20.x | ||||||||||||||||||||
| node-version: 20 | ||||||||||||||||||||
| registry-url: 'https://registry.npmjs.org' | ||||||||||||||||||||
| - name: Update npm to latest (required for OIDC) | ||||||||||||||||||||
| run: npm install -g npm@latest | ||||||||||||||||||||
| - uses: rlespinasse/github-slug-action@v4.x | ||||||||||||||||||||
| - name: Append commit hash to package version | ||||||||||||||||||||
| run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json' | ||||||||||||||||||||
| - name: Disable pre- and post-publish actions | ||||||||||||||||||||
| run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json' | ||||||||||||||||||||
| - uses: JS-DevTools/npm-publish@v4.1.4 | ||||||||||||||||||||
| - name: Clear npm authentication cache | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| rm -rf ~/.npm/_cacache || true | ||||||||||||||||||||
| rm -f ~/.npmrc || true | ||||||||||||||||||||
| - name: Verify npm version | ||||||||||||||||||||
| run: npm --version | ||||||||||||||||||||
| - name: Check npm configuration | ||||||||||||||||||||
| run: npm config list | ||||||||||||||||||||
|
Comment on lines
+88
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Are these steps necessary? |
||||||||||||||||||||
| - name: Publish to npm | ||||||||||||||||||||
| if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| token: ${{ secrets.NPM_TOKEN }} | ||||||||||||||||||||
| tag: ${{ env.GITHUB_REF_SLUG }} | ||||||||||||||||||||
| run: npm publish --tag ${{ env.GITHUB_REF_SLUG }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| npm-publish-latest: | ||||||||||||||||||||
| needs: [build, npm-publish-build] | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| if: github.ref == 'refs/heads/main' | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| id-token: write # Required for OIDC | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - uses: actions/download-artifact@v7 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| name: build | ||||||||||||||||||||
| - uses: actions/setup-node@v6 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: 20.x | ||||||||||||||||||||
| node-version: 20 | ||||||||||||||||||||
| registry-url: 'https://registry.npmjs.org' | ||||||||||||||||||||
| - name: Update npm to latest (required for OIDC) | ||||||||||||||||||||
| run: npm install -g npm@latest | ||||||||||||||||||||
| - name: Disable pre- and post-publish actions | ||||||||||||||||||||
| run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json' | ||||||||||||||||||||
| - uses: JS-DevTools/npm-publish@v4.1.4 | ||||||||||||||||||||
| - name: Clear npm authentication cache | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| rm -rf ~/.npm/_cacache || true | ||||||||||||||||||||
| rm -f ~/.npmrc || true | ||||||||||||||||||||
| - name: Verify npm version | ||||||||||||||||||||
| run: npm --version | ||||||||||||||||||||
| - name: Check npm configuration | ||||||||||||||||||||
| run: npm config list | ||||||||||||||||||||
| - name: Publish to npm | ||||||||||||||||||||
|
Comment on lines
+119
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these steps necessary?
Suggested change
|
||||||||||||||||||||
| if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| token: ${{ secrets.NPM_TOKEN }} | ||||||||||||||||||||
| tag: latest | ||||||||||||||||||||
| run: npm publish --tag latest | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ | |
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/solidos/solid-ui.git" | ||
| "url": "git+https://github.com/SolidOS/solid-ui.git" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is out of scope for this PR. |
||
| }, | ||
| "keywords": [ | ||
| "solid", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top-level permissions should not be required in conjunction with job-level permissions