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

Upload rolling pre-releases #182

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

ahelwer
Copy link
Collaborator

@ahelwer ahelwer commented Nov 29, 2024

Finally got around to this. This sets up rolling pre-release publishing similar to what exists for the TLA+ tools, where the head of the main branch is built and uploaded to a github release for ease of consumption.

This work requires some changes to the repository settings:

  1. Create a release environment and constrain it to only be accessible from the main branch
  2. Create a new pre-release titled (for example) Version 1.6.0 rolling pre-release or similar
  3. Create a fine-grained personal access token with read/write access to releases in the tlaplus/tlapm repo
  4. Store the access token in the release environment secrets as TLAPM_RELEASES_AT
  5. Define the ROLLING_PRERELEASE_VERSION environment variable in the release environment to be 1.6.0-pre or similar
  6. Define the ROLLING_PRERELEASE_GITHUB_NAME environment variable in the release environment to be whatever you called the release in step (2)

If you give me more permissions on this repo I'll do all of that or whoever is reviewing this can do it themselves. I've tested this on my own fork of the TLAPM repo; you can see what the release with uploaded artifacts looks like here: https://github.com/ahelwer/tlapm/releases/tag/1.6.0-pre

This is a good first step to get this working and then later we can add the following features:

  1. Update the tag associated with the release to track the head of the main branch
  2. Do macOS code signing (ref Sign TLAPS release to be accepted by macOS gatekeeper #46)
  3. Upload the releases to the Inria server as well

Ref #92

@ahelwer ahelwer force-pushed the publish-rolling-prerelease branch 2 times, most recently from cd8ecde to 6f035b2 Compare December 2, 2024 20:55
@ahelwer
Copy link
Collaborator Author

ahelwer commented Dec 4, 2024

@lemmy Stephan made me an admin of this repo, but it does not appear fine-grained personal access tokens are yet enabled for the tlaplus organization. Would you be able to enable them? Then I can create a PAT scoped only to modify TLAPM releases. Here are the instructions: https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization#restricting-access-by-personal-access-tokens

For token expiration policy I do think it's fine to leave it as unbounded (no expiration) but that's up to you. I believe you can also add the necessity of requesting approval before users can create PATs for repos under the tlaplus org; not sure how that flow works, guess we can try it. I believe PATs created by a user can never exceed the permissions that user already possesses.

Signed-off-by: Andrew Helwer <2n8rn1w1f@mozmail.com>
@ahelwer ahelwer force-pushed the publish-rolling-prerelease branch from 6f035b2 to 582444e Compare December 4, 2024 19:32
@ahelwer
Copy link
Collaborator Author

ahelwer commented Dec 4, 2024

Actually I just learned about GITHUB_TOKEN so that won't be necessary. Might be useful to enable PATs in general though.

@ahelwer ahelwer merged commit c1c282e into tlaplus:main Dec 4, 2024
5 checks passed
@ahelwer ahelwer deleted the publish-rolling-prerelease branch December 4, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant