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

[AOB-353] Release process support in github workflows #14

Merged
merged 13 commits into from
Apr 14, 2023

Conversation

piyush-daga
Copy link
Member

@piyush-daga piyush-daga commented Apr 13, 2023

To release a new version, update the version.go file in develop, and then fast-forward merge develop into master. That will auto-create the tag and the release.

Example release that was created: https://github.com/postmanlabs/postman-go-sdk/releases (from an old tag)

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
Copy link
Contributor

Choose a reason for hiding this comment

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

what does fetch-depth do ?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we don't use fetch-depth=0 then it will do a shallow fetch of the latest commit. Which is the best case in most scenarios, but here we want to find older tags, which will not come with a shallow fetch. Hence, we're fetching the complete repo. This would be troublesome for large repos, we won't have that problem. ref: actions/checkout#701

echo "new_tag=$new_tag" >> "$GITHUB_OUTPUT"

- name: Version check result
if: steps.latest_tag.outputs.latest_tag == steps.set_tag.outputs.new_tag
Copy link
Contributor

Choose a reason for hiding this comment

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

devil's advocate what is it's latest<new_tag

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, had the same thought, not sure how to handle that though. We could match against all existing tags as well. Will see if that is possible here.

tag_prefix: ''

- name: Create a GitHub release
uses: ncipollo/release-action@v1.9.0
Copy link
Contributor

Choose a reason for hiding this comment

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

both are single maintainer projects, should we rely on them ?

nodejs is using this
postman-eng/action-gh-release@v1

Copy link
Member Author

Choose a reason for hiding this comment

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

Will check if it produces the same release style then we're good to go 👍🏼

Copy link
Contributor

Choose a reason for hiding this comment

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

Also nodejs push tags to master was failing in action, because master is protected branch.
AFAIK there is no way in github action to allow github bots to push.

How's that solved here ?

@gmann42
Copy link
Contributor

gmann42 commented Apr 13, 2023

Can we create a contributing.md file, with actual commands to release a new version ?

@piyush-daga piyush-daga merged commit e1636c2 into develop Apr 14, 2023
3 checks passed
@piyush-daga piyush-daga deleted the feature/release-process branch April 14, 2023 06:51
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.

None yet

2 participants