|
17 | 17 | description: 'Whether to notify the team on Discord when the release fails. Useful if this workflow is called from an automation.'
|
18 | 18 | required: false
|
19 | 19 | type: boolean
|
| 20 | + only_packages: |
| 21 | + description: Packages to publish (space separated) |
| 22 | + type: string |
| 23 | + skip_packages: |
| 24 | + description: Packages to NOT publish (space separated) |
| 25 | + type: string |
| 26 | + dry: |
| 27 | + required: true |
| 28 | + description: Dry run instead of publish? |
| 29 | + type: boolean |
| 30 | + default: true |
20 | 31 | secrets:
|
21 | 32 | DISCORD_WEBHOOK_URL:
|
22 | 33 | description: 'Discord webhook URL to notify on failure. Only required if enableFailureNotification is true.'
|
@@ -61,10 +72,36 @@ jobs:
|
61 | 72 | if: steps.node_modules.outputs.cache-hit != 'true'
|
62 | 73 | - run: yarn --cwd scripts/release install --frozen-lockfile
|
63 | 74 | if: steps.node_modules.outputs.cache-hit != 'true'
|
| 75 | + - run: cp ./scripts/release/ci-npmrc ~/.npmrc |
64 | 76 | - run: |
|
65 | 77 | GH_TOKEN=${{ secrets.GH_TOKEN }} scripts/release/prepare-release-from-ci.js --skipTests -r ${{ inputs.release_channel }} --commit=${{ inputs.commit_sha }}
|
66 |
| - cp ./scripts/release/ci-npmrc ~/.npmrc |
67 |
| - scripts/release/publish.js --ci --tags ${{ inputs.dist_tag }} |
| 78 | + - name: Check prepared files |
| 79 | + run: ls -R build/node_modules |
| 80 | + - if: '${{ inputs.only_packages }}' |
| 81 | + name: 'Publish ${{ inputs.only_packages }}' |
| 82 | + run: | |
| 83 | + scripts/release/publish.js \ |
| 84 | + --ci \ |
| 85 | + --skipTests \ |
| 86 | + --tags=${{ inputs.dist_tag }} \ |
| 87 | + --onlyPackages=${{ inputs.only_packages }} ${{ (inputs.dry && '') || '\'}} |
| 88 | + ${{ inputs.dry && '--dry'}} |
| 89 | + - if: '${{ inputs.skip_packages }}' |
| 90 | + name: 'Publish all packages EXCEPT ${{ inputs.skip_packages }}' |
| 91 | + run: | |
| 92 | + scripts/release/publish.js \ |
| 93 | + --ci \ |
| 94 | + --skipTests \ |
| 95 | + --tags=${{ inputs.dist_tag }} \ |
| 96 | + --skipPackages=${{ inputs.skip_packages }} ${{ (inputs.dry && '') || '\'}} |
| 97 | + ${{ inputs.dry && '--dry'}} |
| 98 | + - if: '${{ !(inputs.skip_packages && inputs.only_packages) }}' |
| 99 | + name: 'Publish all packages' |
| 100 | + run: | |
| 101 | + scripts/release/publish.js \ |
| 102 | + --ci \ |
| 103 | + --tags=${{ inputs.dist_tag }} ${{ (inputs.dry && '') || '\'}} |
| 104 | + ${{ inputs.dry && '--dry'}} |
68 | 105 | - name: Notify Discord on failure
|
69 | 106 | if: failure() && inputs.enableFailureNotification == true
|
70 | 107 | uses: tsickert/discord-webhook@86dc739f3f165f16dadc5666051c367efa1692f4
|
|
0 commit comments