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

build: get version from the latest tag #72

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

wzieba
Copy link
Collaborator

@wzieba wzieba commented Sep 15, 2023

Instead of hardcoding version in repository files.

Closes: #50

Description

This PR is a small improvement to the release process. Instead of updating a hard-coded version, now the version will be determined by the latest Git tag. It saves a little of overhead and number of actions needed to release a new SDK.

How to test

  1. Checkout this branch
  2. Open publication.gradle
  3. Comment out content of signing extension (no need to test artifacts signing)
  4. Add a new tag, e.g. git tag parsely_testing
  5. Run ./gradlew publishToMavenLocal
  6. Open ~/.m2/repository/com/parsely/parsely/
  7. Assert you can see directory named parsely_testing
  8. Open the directory
  9. Open parsely_testing.pom
  10. Assert you can see <version>parsely_testing</version> tag
  11. Remove the tag (git tag -d parsely_testing)
  12. Run steps 5-10, but look for 3.0.8 version (latest tag)

Documentation update

If this PR will be merged, I'll update our internal documentation to reflect this change.

Instead of hardcoding version in repository files.
By default, the `actions/checkout` action fetches only the latest commit
(`--depth=1`). We needed to fetch complete history of commits and tags
to correctly determine version of the library.
@wzieba wzieba force-pushed the issue/50_use_git_tag_when_publishing_library branch from 6df6a4e to d62d1b4 Compare September 15, 2023 12:17
@wzieba wzieba marked this pull request as ready for review September 15, 2023 12:21
@wzieba wzieba requested a review from ParaskP7 September 15, 2023 12:21
@ParaskP7 ParaskP7 self-assigned this Sep 18, 2023
Copy link
Collaborator

@ParaskP7 ParaskP7 left a comment

Choose a reason for hiding this comment

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

👋 @wzieba !

I have reviewed and tested this PR as per the instructions, works like a charm, thanks for making this change! 🌟 🌟 🌟

@wzieba wzieba merged commit f03a6e7 into master Oct 2, 2023
1 check passed
@wzieba wzieba deleted the issue/50_use_git_tag_when_publishing_library branch October 2, 2023 12:00
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.

Version could be determined by Git tag
2 participants