-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
When manually run on this branch with testing_hydra_eval_id=1810420, the job https://github.com/NixOS/experimental-nix-installer/actions/runs/12437588365/job/34727771233 successfully created https://github.com/NixOS/experimental-nix-installer/releases/tag/untagged-5ef306e0d104df16766b |
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.
|
||
hydra_eval = response.json()['evals'][0] | ||
rev = subprocess.run( | ||
["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, check=True, text=True |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"] |
There was a problem hiding this comment.
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.
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.