-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Package tag changelog generation #179
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
Draft
lanesawyer
wants to merge
5
commits into
main
Choose a base branch
from
lane/package-tag-changelogs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
25df35d
feat: Package tag changelog generation
lanesawyer 2bf68f6
didn't need quotes
lanesawyer a6093fb
Don't filter out unconvenctional commits so we can see everything!
lanesawyer c80151a
Merge branch 'main' into lane/package-tag-changelogs
lanesawyer 225944c
Merge branch 'main' into lane/package-tag-changelogs
lanesawyer 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,165 @@ | ||
| name: Release Package | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| package: | ||
| description: 'Package to release' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - core | ||
| - dzi | ||
| - geometry | ||
| - omezarr | ||
| - web-components | ||
|
|
||
| permissions: | ||
| contents: write | ||
| packages: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9.14.2 | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config --local user.email "[email protected]" | ||
| git config --local user.name "GitHub Action" | ||
|
|
||
| # Set the remote URL to use the token for pushing | ||
| git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | ||
|
|
||
| - name: Get current version and determine next version | ||
| id: version_info | ||
| run: | | ||
| cd packages/${{ github.event.inputs.package }} | ||
|
|
||
| # Get current version | ||
| CURRENT_VERSION=$(node -p "require('./package.json').version") | ||
| echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| # Use git-cliff to determine the next version | ||
| TAG_PATTERN="@alleninstitute/vis-${{ github.event.inputs.package }}@*" | ||
| NEXT_VERSION=$(npx git-cliff --tag-pattern "$TAG_PATTERN" --bumped-version) | ||
|
|
||
| # Extract just the version number (remove the tag prefix) | ||
| NEXT_VERSION=$(echo "$NEXT_VERSION" | sed 's/.*@//') | ||
|
|
||
| echo "next_version=$NEXT_VERSION" >> $GITHUB_OUTPUT | ||
| echo "Current version: $CURRENT_VERSION" | ||
| echo "Next version: $NEXT_VERSION" | ||
|
|
||
| - name: Update version number and create initial tag | ||
| run: | | ||
| cd packages/${{ github.event.inputs.package }} | ||
| # npm version creates a commit and a tag for us | ||
| npm version ${{ steps.version_info.outputs.next_version }} --no-git-tag-version=false | ||
|
|
||
| - name: Generate changelog | ||
| run: | | ||
| cd packages/${{ github.event.inputs.package }} | ||
| pnpm run changelog | ||
|
|
||
| - name: Amend commit with changelog | ||
| run: | | ||
| cd packages/${{ github.event.inputs.package }} | ||
| git add changelog.md | ||
| git commit --amend --no-edit | ||
|
|
||
| - name: Delete the tag created by npm version and create new one | ||
| id: create_tag | ||
| run: | | ||
| cd packages/${{ github.event.inputs.package }} | ||
| TAG_NAME="@alleninstitute/vis-${{ github.event.inputs.package }}@${{ steps.version_info.outputs.next_version }}" | ||
|
|
||
| # Delete the tag created by npm version (it would be just the version number) | ||
| git tag -d v${{ steps.version_info.outputs.next_version }} || true | ||
|
|
||
| # Create a new tag with our naming convention on the amended commit | ||
| git tag -a "$TAG_NAME" -m "Release $TAG_NAME" | ||
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Create release branch and push changes | ||
| run: | | ||
| BRANCH_NAME="release/${{ github.event.inputs.package }}-v${{ steps.version_info.outputs.next_version }}" | ||
| git checkout -b "$BRANCH_NAME" | ||
| git push origin "$BRANCH_NAME" | ||
|
|
||
| - name: Create Pull Request | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const { data: pullRequest } = await github.rest.pulls.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| title: `Release ${{ github.event.inputs.package }} v${{ steps.version_info.outputs.next_version }}`, | ||
| head: `release/${{ github.event.inputs.package }}-v${{ steps.version_info.outputs.next_version }}`, | ||
| base: 'main', | ||
| body: `Automated release for @alleninstitute/vis-${{ github.event.inputs.package }} v${{ steps.version_info.outputs.next_version }}\n\nSee [CHANGELOG](./packages/${{ github.event.inputs.package }}/changelog.md) for details.` | ||
| }); | ||
|
|
||
| // Auto-merge if you have that enabled | ||
| await github.rest.pulls.merge({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: pullRequest.number, | ||
| merge_method: 'squash' | ||
| }); | ||
|
|
||
| - name: Push tag after merge | ||
| run: | | ||
| # Wait a moment for the merge to complete | ||
| sleep 5 | ||
| git checkout main | ||
| git pull origin main | ||
| git push origin ${{ steps.create_tag.outputs.tag_name }} | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: actions/create-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{ steps.create_tag.outputs.tag_name }} | ||
| release_name: "${{ github.event.inputs.package }} v${{ steps.version_info.outputs.next_version }}" | ||
| body: | | ||
| Release of @alleninstitute/vis-${{ github.event.inputs.package }} v${{ steps.version_info.outputs.next_version }} | ||
|
|
||
| See [CHANGELOG](./packages/${{ github.event.inputs.package }}/changelog.md) for details. | ||
| draft: false | ||
| prerelease: false | ||
|
|
||
| - name: Publish to GitHub Packages (if needed) | ||
| run: | | ||
| cd packages/${{ github.event.inputs.package }} | ||
| echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc | ||
| echo "@alleninstitute:registry=https://npm.pkg.github.com" >> .npmrc | ||
|
|
||
| # Build the package first | ||
| pnpm run build | ||
|
|
||
| # Publish to GitHub Packages | ||
| npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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,53 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-07-14 | ||
|
|
||
| ### 🚀 Features | ||
|
|
||
| - Starlight Docs and Example Site ([#157](https://github.com/AllenInstitute/vis/pull/157)) | ||
|
|
||
| ### 🐛 Bug Fixes | ||
|
|
||
| - Color parsing supports hex strings without hash [135] ([#138](https://github.com/AllenInstitute/vis/pull/138)) | ||
| - Export Logger class and raise default log level ([#160](https://github.com/AllenInstitute/vis/pull/160)) | ||
|
|
||
| ### 💼 Other | ||
|
|
||
| - A priority cache with a (better?) api ([#171](https://github.com/AllenInstitute/vis/pull/171)) | ||
|
|
||
| Co-authored-by: Lane Sawyer <[email protected]> | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - Add helpful linting rules ([#127](https://github.com/AllenInstitute/vis/pull/127)) | ||
| - *(deps)* Bump @types/lodash from 4.14.202 to 4.17.16 ([#153](https://github.com/AllenInstitute/vis/pull/153)) | ||
| - *(deps)* Bump @types/lodash from 4.17.16 to 4.17.17 ([#168](https://github.com/AllenInstitute/vis/pull/168)) | ||
| - Dev command, reorganized docs, added stubs ([#163](https://github.com/AllenInstitute/vis/pull/163)) | ||
| - *(deps)* Bump @types/lodash from 4.17.17 to 4.17.19 ([#177](https://github.com/AllenInstitute/vis/pull/177)) | ||
| - *(deps)* Bump @biomejs/biome from 1.9.4 to 2.0.6 ([#174](https://github.com/AllenInstitute/vis/pull/174)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-04-23 | ||
|
|
||
| ### 💼 Other | ||
|
|
||
| - Noah/webworker decoders ([#126](https://github.com/AllenInstitute/vis/pull/126)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-04-08 | ||
|
|
||
| ### 🚀 Features | ||
|
|
||
| - Support for arbitrary color channels in OME-Zarr images [DC-530] ([#123](https://github.com/AllenInstitute/vis/pull/123)) | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - Updates to package versions for Core, Geometry, OmeZarr + examples [DC-530] ([#124](https://github.com/AllenInstitute/vis/pull/124)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-04-04 | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - Rename vis-scatterbrain package to vis-core ([#118](https://github.com/AllenInstitute/vis/pull/118)) | ||
|
|
||
| <!-- generated by git-cliff --> |
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
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 |
|---|---|---|
|
|
@@ -8,9 +8,35 @@ All notable changes to this project will be documented in this file. | |
|
|
||
| - DZI fetch function ([#162](https://github.com/AllenInstitute/vis/pull/162)) | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - Add helpful linting rules ([#127](https://github.com/AllenInstitute/vis/pull/127)) | ||
| - Dev command, reorganized docs, added stubs ([#163](https://github.com/AllenInstitute/vis/pull/163)) | ||
| - *(deps)* Bump @biomejs/biome from 1.9.4 to 2.0.6 ([#174](https://github.com/AllenInstitute/vis/pull/174)) | ||
| - Add Changelogs ([#117](https://github.com/AllenInstitute/vis/pull/117)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-04-08 | ||
|
|
||
| ### 💼 Other | ||
|
|
||
| - Updating DZI package version (remove Scatterbrain dependency) ([#125](https://github.com/AllenInstitute/vis/pull/125)) | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - Rename vis-scatterbrain package to vis-core ([#118](https://github.com/AllenInstitute/vis/pull/118)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-03-31 | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - Logger with log levels ([#97](https://github.com/AllenInstitute/vis/pull/97)) | ||
| - Test coverage tooling ([#95](https://github.com/AllenInstitute/vis/pull/95)) | ||
| - Updating vis-dzi and vis-omezarr to enable use of vis-scatterbrain 0.0.10 ([#112](https://github.com/AllenInstitute/vis/pull/112)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-03-14 | ||
|
|
||
| ### 🐛 Bug Fixes | ||
|
|
||
| - Dzi viewer would loop forever due to some faulty math ([#43](https://github.com/AllenInstitute/vis/pull/43)) | ||
| - CI tests weren't running [DT-7060] ([#87](https://github.com/AllenInstitute/vis/pull/87)) | ||
|
|
||
| ### 💼 Other | ||
|
|
@@ -19,21 +45,44 @@ All notable changes to this project will be documented in this file. | |
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - CI workflow [DT-5996] ([#25](https://github.com/AllenInstitute/vis/pull/25)) | ||
| - Update version ([#39](https://github.com/AllenInstitute/vis/pull/39)) | ||
| - Remove only-allow so builds stop failing ([#47](https://github.com/AllenInstitute/vis/pull/47)) | ||
| - Version bumps for only-allow removal release ([#51](https://github.com/AllenInstitute/vis/pull/51)) | ||
| - Install Biome, fix formatting [DT-7060] ([#52](https://github.com/AllenInstitute/vis/pull/52)) | ||
| - Biome linting with auto-fixes [DT-7060] ([#53](https://github.com/AllenInstitute/vis/pull/53)) | ||
| - Dependency health configurations ([#17](https://github.com/AllenInstitute/vis/pull/17)) | ||
| - Clean up dependencies [DT-7060] ([#55](https://github.com/AllenInstitute/vis/pull/55)) | ||
| - Fix all but non-null assertion lints ([#96](https://github.com/AllenInstitute/vis/pull/96)) | ||
| - Logger with log levels ([#97](https://github.com/AllenInstitute/vis/pull/97)) | ||
| - Test coverage tooling ([#95](https://github.com/AllenInstitute/vis/pull/95)) | ||
| - Updating vis-dzi and vis-omezarr to enable use of vis-scatterbrain 0.0.10 ([#112](https://github.com/AllenInstitute/vis/pull/112)) | ||
| - Rename vis-scatterbrain package to vis-core ([#118](https://github.com/AllenInstitute/vis/pull/118)) | ||
| - Add helpful linting rules ([#127](https://github.com/AllenInstitute/vis/pull/127)) | ||
| - Dev command, reorganized docs, added stubs ([#163](https://github.com/AllenInstitute/vis/pull/163)) | ||
| - *(deps)* Bump @biomejs/biome from 1.9.4 to 2.0.6 ([#174](https://github.com/AllenInstitute/vis/pull/174)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2025-02-03 | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - Remove only-allow so builds stop failing ([#47](https://github.com/AllenInstitute/vis/pull/47)) | ||
| - Version bumps for only-allow removal release ([#51](https://github.com/AllenInstitute/vis/pull/51)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2024-12-04 | ||
|
|
||
| ### 💼 Other | ||
|
|
||
| - Noah/documentation ([#46](https://github.com/AllenInstitute/vis/pull/46)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2024-11-21 | ||
|
|
||
| ### 🐛 Bug Fixes | ||
|
|
||
| - Dzi viewer would loop forever due to some faulty math ([#43](https://github.com/AllenInstitute/vis/pull/43)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2024-11-13 | ||
|
|
||
| ### ⚙️ Miscellaneous Tasks | ||
|
|
||
| - CI workflow [DT-5996] ([#25](https://github.com/AllenInstitute/vis/pull/25)) | ||
| - Update version ([#39](https://github.com/AllenInstitute/vis/pull/39)) | ||
|
|
||
| ## [alleninstitute/[email protected]] - 2024-10-02 | ||
|
|
||
| ### 💼 Other | ||
|
|
||
| - DZI viewer component ([#29](https://github.com/AllenInstitute/vis/pull/29)) | ||
|
|
||
| Co-authored-by: Lane Sawyer <[email protected]> | ||
|
|
||
| <!-- generated by git-cliff --> | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I didn't do this right, I meant to remove all but the verison number but this is resulting in headers like "alleninstitute/[email protected]" instead of "0.0.4"