-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adopt gha-scala-rel-workflow in the project #166
Conversation
gha-scala process ref: https://github.com/guardian/gha-scala-library-release-workflow/blob/main/docs/configuration.md Since it requires release on both maven and npm. hence we have taken npm release changes from content-api-models. ref:https://github.com/guardian/content-api-models/blob/main/.github/workflows/release.yml
d6e4687
to
52dfa5b
Compare
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.
Looks great! Just a couple of tweaks to make, the most important is the typescriptClasses
change, as otherwise I think the typescript release won't work.
.github/workflows/release.yml
Outdated
echo "Releasing version $VERSION Sonatype as production" | ||
|
||
yes | sbt -DRELEASE_TYPE=production "clean" "release cross release-version $VERSION with-defaults" "project typescriptClasses" "releaseNpm $VERSION" | ||
sbt "project typescript" "releaseNpm ${{ needs.scala-maven-release.outputs.RELEASE_VERSION }}" |
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.
I think this repo has slightly different typescript sub-project naming to content-api-models
(where the sub-project is just called typescript
), so we need this:
sbt "project typescript" "releaseNpm ${{ needs.scala-maven-release.outputs.RELEASE_VERSION }}" | |
sbt "project typescriptClasses" "releaseNpm ${{ needs.scala-maven-release.outputs.RELEASE_VERSION }}" |
...see:
Line 148 in 8a8b60c
lazy val typescriptClasses = (project in file("ts")) |
It would be nice if both projects had a uniform layout and naming, but that might be for another PR!
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.
Very well spotted, it's making more sense to me now.
I will change the typescript project name.
|
||
When the release process has finished, pull the updated `main` branch locally and update the `version.sbt` file to reflect the next build number, e.g. `1.0.11-SNAPSHOT` and commit that directly back to `main` - there's no need to open a PR for that. | ||
|
||
When your release shows up on [maven](https://repo1.maven.org/maven2/com/gu/content-api-firehose-client_2.13/) the updated version can be referenced in client code. |
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.
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 looks great, but note there is now one final additional change we need adding GITHUB_APP_PRIVATE_KEY
!
looks great Co-authored-by: Roberto Tyley <roberto.tyley@gmail.com>
We have successfully made a gha-scala released version on both npm and maven NPM release can be found at: https://www.npmjs.com/package/@guardian/content-atom-model?activeTab=versions |
Changes
Implementing
gha-scala-release-workflow
process ref: https://github.com/guardian/gha-scala-library-release-workflow/blob/main/docs/configuration.mdto have release process with organisation based secrets, more secured, less code for maintainability, easy to deploy on both maven and npm.
Since it requires release on npm as well. We have taken npm release changes from content-api-models ref:https://github.com/guardian/content-api-models/blob/main/.github/workflows/release.yml