|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + node-version: [18.x, 20.x] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4.1.7 |
| 19 | + - uses: ./.github/actions/turbo-build |
| 20 | + with: |
| 21 | + node-version: ${{ matrix.node-version }} |
| 22 | + |
| 23 | + npm-publish: |
| 24 | + if: github.ref == 'refs/heads/main' |
| 25 | + needs: [build] |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4.1.7 |
| 29 | + - uses: ./.github/actions/turbo-build |
| 30 | + - name: "@substrate/connect Publish" |
| 31 | + id: publish_connect |
| 32 | + uses: ./.github/actions/publish-package |
| 33 | + with: |
| 34 | + token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |
| 35 | + package-directory: ./packages/connect |
| 36 | + - name: "@substrate/connect-extension-protocol Publish" |
| 37 | + id: publish_connect_extension_protocol |
| 38 | + uses: ./.github/actions/publish-package |
| 39 | + with: |
| 40 | + token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |
| 41 | + package-directory: ./packages/connect-extension-protocol |
| 42 | + - name: "@substrate/connect-known-chains Publish" |
| 43 | + uses: ./.github/actions/publish-package |
| 44 | + with: |
| 45 | + token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |
| 46 | + package-directory: ./packages/connect-known-chains |
| 47 | + - name: "@substrate/light-client-extension-helpers Publish" |
| 48 | + uses: ./.github/actions/publish-package |
| 49 | + with: |
| 50 | + token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |
| 51 | + package-directory: ./packages/light-client-extension-helpers |
| 52 | + - name: "@substrate/connect-discovery" |
| 53 | + uses: ./.github/actions/publish-package |
| 54 | + with: |
| 55 | + token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |
| 56 | + package-directory: ./packages/connect-discovery |
| 57 | + - name: "@substrate/discovery" |
| 58 | + uses: ./.github/actions/publish-package |
| 59 | + with: |
| 60 | + token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |
| 61 | + package-directory: ./packages/discovery |
| 62 | + - name: "@substrate/smoldot-discovery" |
| 63 | + uses: ./.github/actions/publish-package |
| 64 | + with: |
| 65 | + token: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }} |
| 66 | + package-directory: ./packages/smoldot-discovery |
| 67 | + - name: Fetch gh-pages |
| 68 | + if: steps.publish_connect.outputs.type || steps.publish_connect_extension_protocol.outputs.type |
| 69 | + run: | |
| 70 | + git remote set-branches origin gh-pages |
| 71 | + git fetch --depth 1 origin gh-pages |
| 72 | + - name: Deploy Projects & Docs |
| 73 | + if: steps.publish_connect.outputs.type || steps.publish_connect_extension_protocol.outputs.type |
| 74 | + run: pnpm deploy-projects-and-docs |
| 75 | + |
| 76 | + all: |
| 77 | + # This dummy job depends on all the mandatory checks. It succeeds if and only if all CI checks |
| 78 | + # are successful. |
| 79 | + needs: [build, npm-publish] |
| 80 | + runs-on: ubuntu-latest |
| 81 | + steps: |
| 82 | + - run: echo Success |
0 commit comments