Skip to content

Commit

Permalink
chore: snapshot release for PRs (#3)
Browse files Browse the repository at this point in the history
- 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
JoCa96 authored Dec 20, 2023
1 parent 55e0e1f commit 0c89aad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/prerelease.yml → .github/workflows/release.yml
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
Expand All @@ -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
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "docs",
"version": "0.0.0",
"type": "module",
"private": true,
"scripts": {
"dev": "vitepress dev src",
"build": "vitepress build src",
Expand Down

0 comments on commit 0c89aad

Please sign in to comment.