|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + branches: [master] |
4 | 6 | release: |
5 | 7 | types: [published] |
6 | 8 |
|
@@ -41,21 +43,34 @@ jobs: |
41 | 43 | if: steps.cache.outputs.cache-hit != 'true' |
42 | 44 | run: npm install |
43 | 45 |
|
44 | | - - name: Calculate environment variables |
| 46 | + - name: Resolve release metadata |
45 | 47 | run: | |
46 | | - echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV |
| 48 | + if [ "${{ github.event_name }}" = "release" ]; then |
| 49 | + echo "RELEASE_KIND=release" >> $GITHUB_ENV |
| 50 | + echo "RELEASE_CHANNEL=$(npm run release-channel --silent)" >> $GITHUB_ENV |
| 51 | + else |
| 52 | + echo "RELEASE_KIND=insiders" >> $GITHUB_ENV |
| 53 | + echo "INSIDERS_VERSION=0.0.0-insiders.$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
| 54 | + echo "RELEASE_CHANNEL=insiders" >> $GITHUB_ENV |
| 55 | + fi |
| 56 | +
|
| 57 | + - name: Version `heroicons` based on commit |
| 58 | + if: env.RELEASE_KIND == 'insiders' |
| 59 | + run: npm version "$INSIDERS_VERSION" --force --no-git-tag-version |
| 60 | + |
| 61 | + - name: Version `@heroicons/react` based on commit |
| 62 | + if: env.RELEASE_KIND == 'insiders' |
| 63 | + run: npm version "$INSIDERS_VERSION" --force --no-git-tag-version --prefix react |
| 64 | + |
| 65 | + - name: Version `@heroicons/vue` based on commit |
| 66 | + if: env.RELEASE_KIND == 'insiders' |
| 67 | + run: npm version "$INSIDERS_VERSION" --force --no-git-tag-version --prefix vue |
47 | 68 |
|
48 | 69 | - name: Publish `heroicons` |
49 | | - run: npm publish --provenance --tag ${{ env.RELEASE_CHANNEL }} |
50 | | - env: |
51 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 70 | + run: npm publish --provenance --tag "$RELEASE_CHANNEL" |
52 | 71 |
|
53 | 72 | - name: Publish `@heroicons/react` |
54 | | - run: npm publish ./react --provenance --tag ${{ env.RELEASE_CHANNEL }} |
55 | | - env: |
56 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 73 | + run: npm publish ./react --provenance --tag "$RELEASE_CHANNEL" |
57 | 74 |
|
58 | 75 | - name: Publish `@heroicons/vue` |
59 | | - run: npm publish ./vue --provenance --tag ${{ env.RELEASE_CHANNEL }} |
60 | | - env: |
61 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 76 | + run: npm publish ./vue --provenance --tag "$RELEASE_CHANNEL" |
0 commit comments