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

feat: create an annotated tag instead of a ligthweight tag to ensure the correct timestamp #26

Merged
merged 3 commits into from
Sep 13, 2022

Conversation

dduportal
Copy link
Contributor

This PR fixes #25.

It ensures that an annotated tag is created before publishing the release.

It follows the official Git API documentation about creating tags in https://docs.github.com/en/rest/git/tags#create-a-tag-object:

Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then create the refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference - this call would be unnecessary.

Note: I have no idea how to properly test this in "real life" scenario. I tried in jenkinsci/jenkins-infra-test-plugin#45 but it seems that we use 2 levels of actions and there are "local" actions (e.g. restricted to the organization).

I'll try to publish my modified action to gh action and work with it but it's not really easy: any tip is welcome

@timja
Copy link
Member

timja commented Sep 13, 2022

Note: I have no idea how to properly test this in "real life" scenario. I tried in jenkinsci/jenkins-infra-test-plugin#45 but it seems that we use 2 levels of actions and there are "local" actions (e.g. restricted to the organization).

your repo:
https://github.com/dduportal/github-reusable-workflow

doesn't exist.

you need to fork that and point it to your other repo / branch.

or just push an origin branch

@dduportal
Copy link
Contributor Author

dduportal commented Sep 13, 2022

dduportal added a commit to jenkinsci/jenkins-infra-test-plugin that referenced this pull request Sep 13, 2022
@dduportal dduportal marked this pull request as draft September 13, 2022 13:16
@dduportal
Copy link
Contributor Author

Current testing says: + gh api -F tag=98.vb_b_93ee907771 -F message=98.vb_b_93ee907771 -F object=bb93ee907771855f57c71f61eabfece9e2c57594 -F type=commit /repos/jenkinsci/jenkins-infra-test-plugin/git/tag

I guess I have to rework it a bit :)

Copy link
Contributor

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Looks OK, assuming it in fact works in the test plugin.

@dduportal dduportal marked this pull request as ready for review September 13, 2022 16:54
@dduportal
Copy link
Contributor Author

@dduportal dduportal changed the title feat: create an annotated tag instead of a ligthweight tag feat: create an annotated tag instead of a ligthweight tag to ensure the correct timestamp Sep 13, 2022
@dduportal dduportal requested review from timja and jglick September 13, 2022 16:54
@timja timja merged commit 8a7dfc0 into jenkins-infra:master Sep 13, 2022
@dduportal dduportal deleted the feat/annotated-tag branch September 13, 2022 17:38
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.

Use annotated tags when releasing
3 participants