Skip to content

Commit c4e692b

Browse files
authored
Merge pull request #508 from saasquatch/scoped-releases-mint
2 parents 83a4dc2 + 24d89c3 commit c4e692b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/mint-components-release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,30 @@ jobs:
4444
version: npm run version
4545
publish: npm run release
4646
title: "mint-components - Version Packages"
47+
# Suppress changesets/action's built-in GitHub Release creation. We create a scoped tag + release ourselves in the next step.
48+
createGithubReleases: false
4749
env:
4850
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4951
NPM_CONFIG_PROVENANCE: true
5052

53+
- name: Create scoped GitHub Release
54+
if: steps.changesets.outputs.published == 'true'
55+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # ed597 = v8
56+
env:
57+
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
58+
with:
59+
script: |
60+
const [{ name, version }] = JSON.parse(process.env.PUBLISHED_PACKAGES);
61+
const tag = `${name}@${version}`;
62+
await github.rest.repos.createRelease({
63+
...context.repo,
64+
tag_name: tag,
65+
name: tag,
66+
target_commitish: context.sha,
67+
body: "See packages/mint-components/CHANGELOG.md for details.",
68+
prerelease: version.includes("-"),
69+
});
70+
5171
- name: Build docs site
5272
if: steps.changesets.outputs.published == 'true'
5373
run: NODE_ENV=dev npm run build

0 commit comments

Comments
 (0)