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

Rework release-script to use GitHub releases #31

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Rework release-script to use GitHub releases #31

merged 1 commit into from
Dec 20, 2024

Conversation

mkenigs
Copy link
Collaborator

@mkenigs mkenigs commented Dec 20, 2024

Instead of committing builds of the installer to the prerelease branch using a cronjob, create draft GitHub releases on workflow dispatch.

The release includes the nix-installer.sh script to allow running curl https://github.com/NixOS/experimental-nix-installer/releases/download/v0.27.0/nix-installer.sh | bash

Or to get the latest release:
curl https://github.com/NixOS/experimental-nix-installer/releases/latest/download/nix-installer.sh | bash

Alternatively, binaries for each system can be downloaded from the release directly.

The version number is substituted in the nix-installer.sh file included in the release so that we don't have to bump it every time we do a release.

The release job will error if there's a rev mismatch between the flake built by Hydra and the rev the job is run from. This means we'll only be able to run the job off of main.

For testing, a Hydra eval ID can be specified, which skips the rev check. This will create a draft release using the artifacts from that Hydra eval even if there is a revision and/or version mismatch.

@mkenigs
Copy link
Collaborator Author

mkenigs commented Dec 20, 2024

Instead of committing builds of the installer to the prerelease branch
using a cronjob, create draft GitHub releases on workflow dispatch.

The release includes the nix-installer.sh script to allow running
`curl https://github.com/NixOS/experimental-nix-installer/releases/download/v0.27.0/nix-installer.sh | bash`

Or to get the latest release:
`curl https://github.com/NixOS/experimental-nix-installer/releases/latest/download/nix-installer.sh | bash`

Alternatively, binaries for each system can be downloaded from the
release directly.

The version number is substituted in the nix-installer.sh file included
in the release so that we don't have to bump it every time we do a
release.

The release job will error if there's a rev mismatch between the flake
built by Hydra and the rev the job is run from. This means we'll only be
able to run the job off of main.

For testing, a Hydra eval ID can be specified, which skips the rev check. This
will create a draft release using the artifacts from that Hydra eval even if
there is a revision and/or version mismatch.
@mkenigs mkenigs marked this pull request as ready for review December 20, 2024 19:57

hydra_eval = response.json()['evals'][0]
rev = subprocess.run(
["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, check=True, text=True
Copy link
Member

Choose a reason for hiding this comment

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

Just to hit my quota on proof that I'm actually paying attention, I think this could come from GITHUB_SHA.

That said, I'm not suggesting it change here unless you prefer that. I think it's defensible to keep as is to avoid the extra dependency on the GHA environment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it was convenient to use git when iterating locally

subprocess.run(["git", "checkout", "-b", "prerelease", "origin/prerelease"], check=True)
with open("Cargo.toml", "rb") as f:
cargo_toml = tomllib.load(f)
version = cargo_toml["package"]["version"]
Copy link
Member

Choose a reason for hiding this comment

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

I think this is the most-reasonable action atm, but in case someone's reading back over this for context later (I've already gotten a Q from the Nix team about how we're versioning this) I'll caution:

This tracks the detsys versioning. I think that's very defensible, here.

It saves us from having to debate a call about how to version this that may or may not mesh with how the Nix team and/or broader org/community want to see this installer versioned relative to Nix and upstream.

This installer may well have a different relationship to Nix than the DetSys upstream does (i.e., we don't know if it'll always iterate with and use the latest Nix, or if it'll use some notion of "stable" nix like detsys and nixpkgs do, etc.)

If you're here from the future: we need something for now, but don't treat this as a well-considered decision if you have good reasons to do something different.

@mkenigs mkenigs merged commit d028660 into main Dec 20, 2024
18 checks passed
@mkenigs mkenigs deleted the release branch December 20, 2024 21: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.

2 participants