Skip to content
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

Merged
merged 4 commits into from
Mar 6, 2024

Conversation

Divs-B
Copy link
Contributor

@Divs-B Divs-B commented Jan 29, 2024

Changes

Implementing gha-scala-release-workflow process ref: https://github.com/guardian/gha-scala-library-release-workflow/blob/main/docs/configuration.md
to 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

@Divs-B Divs-B requested review from a team as code owners January 29, 2024 16:07
@Divs-B Divs-B force-pushed the db/adopt-gha-scala-release-workflow branch from d6e4687 to 52dfa5b Compare January 29, 2024 16:11
@Divs-B Divs-B requested a review from rtyley January 29, 2024 16:12
Copy link
Member

@rtyley rtyley left a 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.

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 }}"
Copy link
Member

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:

Suggested change
sbt "project typescript" "releaseNpm ${{ needs.scala-maven-release.outputs.RELEASE_VERSION }}"
sbt "project typescriptClasses" "releaseNpm ${{ needs.scala-maven-release.outputs.RELEASE_VERSION }}"

...see:

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!

Copy link
Contributor Author

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.
Copy link
Member

@rtyley rtyley Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can probably also delete the section above this - all of this stuff, I think? :

image

...because it talks about publishing manually to the Maven & NPM services, but we're not going to support that anymore?

Copy link
Member

@rtyley rtyley left a 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>
@Divs-B Divs-B merged commit dae3433 into main Mar 6, 2024
1 check passed
@Divs-B
Copy link
Contributor Author

Divs-B commented Mar 6, 2024

We have successfully made a gha-scala released version on both npm and maven

image

NPM release can be found at: https://www.npmjs.com/package/@guardian/content-atom-model?activeTab=versions

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants