-
Notifications
You must be signed in to change notification settings - Fork 2
Add GitHub action for header-gen build #6
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 all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c889638
Fix paths in package.json
microbit-robert dbbcd54
Add GitHub action for build workflow
microbit-robert 5752d57
Add cache dependency path
microbit-robert 4e74f4e
Re-run action if build.yml is modified
microbit-robert 58208af
Use non-action package-versioner
microbit-robert c842935
Merge branch 'main' into gh-actions
microbit-robert d89575c
Try using updated GHA to change version
microbit-matt-hillsdon 62676e3
Actually set working-directory
microbit-matt-hillsdon d9cda68
Remove old way
microbit-matt-hillsdon c4fcc49
Working dir change has now been released as 1.1.0
microbit-matt-hillsdon 1c6dbc4
Review feedback and merge into header-gen.yml
microbit-robert c5c193a
Add permissions
microbit-robert 7c5b26e
Don't update version on PR
microbit-robert 7227608
Only publish on GH release
microbit-robert 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
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 @@ | ||
| @microbit-foundation:registry=https://npm.pkg.github.com/microbit-foundation |
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.
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.
This step will also run on any pushes with changes to the header-gen source code, even if they are not meant to update the package version yet (which likely has already increased as we
pxt bumpthe extension), is that the intention?I assume this action only creates a commit if the version in package.json and the version in the last repo tag don't match?
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.
In this case, the action should create a published version with something like @0.1.0-[branch_name].[build_number]. It should never create any commits.
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.
But looking at the description in https://github.com/microbit-foundation/npm-package-versioner-action it sounds like if the package.json version entry needs to be updated it will do that? Does it do it without committing the change to the repo?
So, it changes package.json, builds package, pushes it to the package registry with a temporary tag like
@0.1.0-[branch_name].[build_number]and doesn't commit anything? At what point it will push a package with the correct version number?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.
sorry, the publishing is done by the
npm publishstep.So, the microbit-foundation/npm-package-versioner-action action will change the package.json version entry if needed (maybe to
0.1.0-[branch_name].[build_number]as you mentioned), without committing anything and then it's up to other steps to create and/or publish the package. Is that right?How does it decide if the version entry in package.json needs to be changed? is it if this commit is tagged AND the tag version is the same as the version in package.json?
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.
Apologies. This is ignorance on my part. We've not used this in prod yet and I naively assumed it would work in the same way as the package it's trying to replace.
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.
OK. It looks like it just changes the version in package.json without commiting anything. The udpated version number is only used for
npm publishin that workflow.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.
Great, thanks Rob!