Skip to content

Commit 32548fa

Browse files
committed
merge workflows
1 parent 9c16304 commit 32548fa

2 files changed

Lines changed: 26 additions & 81 deletions

File tree

.github/workflows/release-insiders.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Release
22

33
on:
4+
push:
5+
branches: [master]
46
release:
57
types: [published]
68

@@ -41,21 +43,34 @@ jobs:
4143
if: steps.cache.outputs.cache-hit != 'true'
4244
run: npm install
4345

44-
- name: Calculate environment variables
46+
- name: Resolve release metadata
4547
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
4768

4869
- 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"
5271

5372
- 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"
5774

5875
- 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

Comments
 (0)