-
Notifications
You must be signed in to change notification settings - Fork 0
feat: changeset workflows #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3bdf6be
feat: add changeset-check workflow
agierlicki 5340598
feat: add changeset release workflow
agierlicki b5c2a3d
docs: add docs for changeset check workflow
agierlicki 90b2b8c
docs: update readme versions
agierlicki 6e41aff
docs: typo
agierlicki 8f06aa9
fix: add checkout action to changeset check
agierlicki f27c3e5
fix: fetch and use pr base for diff
agierlicki 87cc068
fix: add origin
agierlicki 915f548
fix: use changed files action to get changesets
agierlicki 1441be8
chore: remove changeset release workflow
agierlicki f36e2bd
chore: undo version bumps
agierlicki 0e29d34
chore: remove trailing space
agierlicki 83455ca
feat: re-add release workflow
agierlicki 18046aa
feat: re-add release workflow
agierlicki 32b5a5c
docs: improve release docs
agierlicki 6ae02b6
docs: fix job name
agierlicki 5d410f8
docs: add file extensions
agierlicki 922201b
fix: use correct tokens
agierlicki f26571a
fix: fix typo in filename
agierlicki 136c626
fix: use app token
agierlicki b759d7d
fix: use app token for checkout
agierlicki 2e201b7
fix: pass npm token correctly
agierlicki 12fff00
fix: don't trigger changeset checks for bot PRs
agierlicki 7493145
ci: debug log npmrc
agierlicki fc31429
fix: use pnpm for publishing
agierlicki 6c398d8
fix: remove cat
agierlicki 986a857
fix: copy npmrc
agierlicki b501df5
fix: add debug output
agierlicki 728e201
fix: set home env var
agierlicki 4bad810
fix: add node auth token
agierlicki e442ee7
chore: review feedback
agierlicki d8346de
fix: final review feedback
agierlicki 950c92b
docs: add descriptions to readme
agierlicki b0e4c46
chore: remove input descriptions
agierlicki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Changeset Check | ||
|
|
||
| on: workflow_call | ||
|
|
||
| jobs: | ||
| changeset-check: | ||
| name: changeset-check | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4.2.2 | ||
|
|
||
| - name: Check for changesets | ||
| id: changeset-files | ||
| uses: tj-actions/changed-files@v45.0.6 | ||
| with: | ||
| files: .changeset/*.md | ||
| base_sha: ${{ github.event.pull_request.base.sha }} | ||
|
|
||
| - name: Find existing comment | ||
| uses: peter-evans/find-comment@v3.1.0 | ||
| id: find_comment | ||
| with: | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| comment-author: "github-actions[bot]" | ||
| body-includes: <!-- changeset-check --> | ||
|
|
||
| - name: Update comment for found changeset | ||
| uses: peter-evans/create-or-update-comment@v4.0.0 | ||
| if: steps.changeset-files.outputs.any_changed == 'true' | ||
| with: | ||
| comment-id: ${{ steps.find_comment.outputs.comment-id }} | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| body: | | ||
| <!-- changeset-check --> | ||
| ## 🦋 Changeset file found | ||
|
|
||
| Good job! A changeset file has been added in this PR. Your changes will be included in the next release. | ||
| edit-mode: replace | ||
|
|
||
| - name: Update comment for missing changeset | ||
| uses: peter-evans/create-or-update-comment@v4.0.0 | ||
| if: steps.changeset-files.outputs.any_changed != 'true' | ||
| with: | ||
| comment-id: ${{ steps.find_comment.outputs.comment-id }} | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| body: | | ||
| <!-- changeset-check --> | ||
| ## ⚠️ Changeset file missing | ||
|
|
||
| No changeset file has been added in this PR. Please consider adding one if this PR contains user-facing changes. | ||
| edit-mode: replace | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: Changeset Release | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| node-version-file: | ||
| description: "The file containing the Node.js version to use, defaults to .nvmrc" | ||
agierlicki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| default: '.nvmrc' | ||
| required: false | ||
| type: string | ||
| publish-script: | ||
| description: "The file script to run on publish. Defaults to `pnpm release`" | ||
| default: 'pnpm release' | ||
| required: false | ||
| type: string | ||
| version-script: | ||
| description: "The file script to run vor bumping the package versions. Defaults to `pnpm changeset version`" | ||
agierlicki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| default: 'pnpm changeset version' | ||
| required: false | ||
| type: string | ||
| secrets: | ||
| app_id: | ||
| required: true | ||
| private_key: | ||
| required: true | ||
|
|
||
| jobs: | ||
| release: | ||
| name: changeset-release | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Get App Token | ||
| uses: actions/create-github-app-token@v1.11.0 | ||
| id: get_token | ||
| with: | ||
| app-id: ${{ secrets.app_id }} | ||
| private-key: ${{ secrets.private_key }} | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4.2.2 | ||
|
|
||
| - name: Setup PNPM | ||
| uses: pnpm/action-setup@v4.0.0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4.1.0 | ||
| with: | ||
| node-version-file: ${{ inputs.node-version-file }} | ||
| cache: 'pnpm' | ||
| registry-url: 'https://npm.pkg.github.com/' | ||
| scope: '@staffbase' | ||
flaxel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Install Dependencies | ||
| run: pnpm install --frozen-lockfile --ignore-scripts | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.STAFFBOT_NPM_WRITE }} | ||
|
|
||
| - name: Create Release Pull Request | ||
| id: changesets | ||
| uses: changesets/action@v1.4.9 | ||
| with: | ||
| commit: 'chore(release): Bump package version' | ||
| title: '📦 Release' | ||
agierlicki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| setupGitUser: true | ||
agierlicki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| createGithubReleases: true | ||
| publish: ${{ inputs.publish-script }} | ||
| version: ${{inputs.version-script}} | ||
agierlicki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| env: | ||
| GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} | ||
| NPM_TOKEN: ${{ secrets.STAFFBOT_NPM_WRITE }} | ||
agierlicki marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.