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

CI: Tweaks for the tag creating jobs #594

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

romainpi
Copy link
Contributor

@romainpi romainpi commented Jul 9, 2024

Hello there, this is a follow up to #589

Code changes

Some tweaks for the Github actions:

  • Makes sure the create-tags-for-past-releases job runs before create-git-tag.
    Since jobs run in parallel create-git-tag could run before create-tags-for-past-releases and would create a tag for 0.19.0 on the latest commit on master. The job create-git-tag will now always run after create-tags-for-past-releases.
  • Have the create-git-tag fetch all Git history to actually be able to detect past tags.
    Now the checkout fetches the whole git history allowing it to see if the current version is indeed tagged or not.

Fine grain token

I have tested with the fine-grain tokens and the following setting works. @est31 may I ask you to do the following please

  1. Regenerate a fine-grain personal access token here with the following settings:
  • Token name: Something like "Token for Rodio CI release tagging"
  • Expiration: Any value you would like, you understand that it will have to be periodically regenerated. The secrets scanning page for the project should theoretically warn you when it is expired.
  • Repository access: You only need to select the RustAudio/Rodio repo.
  • Permissions:
    • Contents: Read and Write (in order to create releases/tags)
    • Metadata: Read (mandatory)
    • Workflows (at the very bottom of the list): Read and Write (because apparently tagging commits which are anywhere near something that modified a workflow file counts as modifying that workflow?)
  1. Edit the WORKFLOW_TOKEN repo secret here (or create the WORKFLOW_TOKEN secret if it doesn't exist) and paste the newly created fine-grained PAT.
  2. Finally merging this very PR.

Here's a screenshot of my fine-grained PAT that succesfully ran on the master of my fork:

Screenshot from 2024-07-09 12-51-55

Thanks!

* Makes sure the `create-tags-for-past-releases` job runs before `create-git-tag`.
* Have the `create-git-tag` fetch all Git history to actually be able to detect past tags.
@dvdsk
Copy link
Collaborator

dvdsk commented Jul 9, 2024

I have applied the old tags locally and can push them. If your okay with that you can remove the create old tags part. That should simplify the workflow.

@est31
Copy link
Member

est31 commented Jul 9, 2024

@romainpi I have updated the WORKFLOW_TOKEN as per your listed steps. Thanks for writing this all up so nicely.

@romainpi
Copy link
Contributor Author

romainpi commented Jul 9, 2024

I have applied the old tags locally and can push them. If your okay with that you can remove the create old tags part. That should simplify the workflow.

Yes well the create-tags-for-past-releases job was meant to be ephemeral. The result will be the same if you merge this PR now or manually push the tags (I can't be sure the tags are correct on your machine but I assume they are - I know the tags coming from this PR are the correct ones IMO). I'm ready to push a PR removing the create-tags-for-past-releases workflow as soon as the tags are activated on this repo!

@romainpi
Copy link
Contributor Author

romainpi commented Jul 9, 2024

I have applied the old tags locally and can push them. If your okay with that you can remove the create old tags part. That should simplify the workflow.

Yes well the create-tags-for-past-releases job was meant to be ephemeral. The result will be the same if you merge this PR now or manually push the tags (I can't be sure the tags are correct on your machine but I assume they are - I know the tags coming from this PR are the correct ones IMO). I'm ready to push a PR removing the create-tags-for-past-releases workflow as soon as the tags are activated on this repo!

Actually @dvdsk it's better to push this PR now because it contains an important fix to the create-git-tag job.

@dvdsk dvdsk merged commit f4b2acf into RustAudio:master Jul 11, 2024
12 checks passed
@dvdsk
Copy link
Collaborator

dvdsk commented Jul 11, 2024

so now we need another PR to remove the epheremal job right?

@romainpi
Copy link
Contributor Author

so now we need another PR to remove the epheremal job right?

Yes indeed! See #596.

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.

3 participants