fix: npm publish automation #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
- uses: ./.github/actions/turbo-build | |
with: | |
node-version: ${{ matrix.node-version }} | |
npm-publish: | |
if: github.ref == 'refs/heads/main' | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
- uses: ./.github/actions/turbo-build | |
- name: "@substrate/connect Publish" | |
id: publish_connect | |
uses: ./.github/actions/publish-package | |
with: | |
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} | |
package-directory: ./packages/connect | |
- name: "@substrate/connect-extension-protocol Publish" | |
id: publish_connect_extension_protocol | |
uses: ./.github/actions/publish-package | |
with: | |
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} | |
package-directory: ./packages/connect-extension-protocol | |
- name: "@substrate/connect-known-chains Publish" | |
uses: ./.github/actions/publish-package | |
with: | |
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} | |
package-directory: ./packages/connect-known-chains | |
- name: "@substrate/light-client-extension-helpers Publish" | |
uses: ./.github/actions/publish-package | |
with: | |
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} | |
package-directory: ./packages/light-client-extension-helpers | |
- name: "@substrate/connect-discovery" | |
uses: ./.github/actions/publish-package | |
with: | |
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} | |
package-directory: ./packages/connect-discovery | |
- name: "@substrate/discovery" | |
uses: ./.github/actions/publish-package | |
with: | |
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} | |
package-directory: ./packages/discovery | |
- name: "@substrate/smoldot-discovery" | |
uses: ./.github/actions/publish-package | |
with: | |
token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} | |
package-directory: ./packages/smoldot-discovery | |
- name: Fetch gh-pages | |
if: steps.publish_connect.outputs.type || steps.publish_connect_extension_protocol.outputs.type | |
run: | | |
git remote set-branches origin gh-pages | |
git fetch --depth 1 origin gh-pages | |
- name: Deploy Projects & Docs | |
if: steps.publish_connect.outputs.type || steps.publish_connect_extension_protocol.outputs.type | |
run: pnpm deploy-projects-and-docs | |
all: | |
# This dummy job depends on all the mandatory checks. It succeeds if and only if all CI checks | |
# are successful. | |
needs: [build, npm-publish] | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo Success |