-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: snapshot release for PRs (#3)
- Added conditiontional snapshot release to pipline - we only want to publish a real version on the main branch - all other branches/prs should only produce a snapshot - Set `apps/docs` as private package as we don't want to publish it
- Loading branch information
Showing
2 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
name: Prerelease | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prerelease: | ||
name: Prerelease | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
@@ -31,12 +32,26 @@ jobs: | |
- name: 👷 Build packages | ||
run: pnpm build-all | ||
|
||
- name: ⛴️ Version and Publish | ||
- name: 🤖 Configure Git Bot | ||
run: | | ||
git config user.name "Release Bot[bot]" | ||
git config user.email "[email protected]" | ||
- name: ⛴️ Version and Publish | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
npx changeset version | ||
npx changeset publish | ||
git add . | ||
git add --all | ||
git commit --amend --no-edit | ||
git push --follow-tags | ||
- name: 📸 Snapshot and Publish | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
run: | | ||
# [Snapshot release fails if repository is in pre-release mode](https://github.com/changesets/changesets/issues/1195) | ||
rm -f .changeset/pre.json | ||
# Add empty changeset so we always have a new snapshot release for each new run | ||
npx changeset add --empty | ||
npx changeset version --snapshot | ||
npx changeset publish --tag snapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters