Repository navigation
Build and publish automation #516
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
Merged
KodrAus
merged 5 commits into
datalust:dev
from
liammclennan-ro:build-and-publish-automation
Nov 25, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1757a9a
Comment
liammclennan-ro 285289d
Update github workflows.
liammclennan-ro 01aaa06
Review feedback. Assisted-by: claude/fable5-2
liammclennan-ro f49a4c7
README
liammclennan-ro 2621ce5
Move Github release creation to a powershell script. Assisted-by: cla…
liammclennan-ro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Creates (or refreshes) the draft GitHub release for a seqcli build, with every file in -AssetDir | ||
| # attached. The tag isn't created until the release is published, at the commit given by -Target. | ||
| # | ||
| # In CI (see draft-release in .github/workflows/publish.yml) the assets are the artifacts of the CI | ||
| # run, and the version is reproduced by Get-SemVer from CI_BUILD_NUMBER_BASE and CI_TARGET_BRANCH. | ||
| # Builds from branches other than `main` are marked as prereleases. If a draft for the tag already | ||
| # exists (left by an earlier attempt of the same run), its assets are replaced instead. | ||
| # | ||
| # The release tag is written to $env:GITHUB_OUTPUT as `tag` when that variable is set. | ||
| # | ||
| # Usage: | ||
| # ./build/Build.Release.ps1 -AssetDir ./release-assets -Target <sha> | ||
| param( | ||
| # Directory containing the files to attach to the release. | ||
| [Parameter(Mandatory)] | ||
| [string] $AssetDir, | ||
|
|
||
| # Commit the release's tag is created at when the release is published. | ||
| [Parameter(Mandatory)] | ||
| [string] $Target, | ||
|
|
||
| # GitHub repository to create the release in. | ||
| [string] $Repo = $env:GITHUB_REPOSITORY | ||
| ) | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| if (-not $Repo) { throw "No repository given; pass -Repo or set GITHUB_REPOSITORY" } | ||
|
|
||
| $assets = @(Get-ChildItem $AssetDir -File | ForEach-Object { $_.FullName }) | ||
| if ($assets.Count -eq 0) { throw "No release assets found in $AssetDir" } | ||
|
|
||
| Push-Location $PSScriptRoot/../ | ||
| try { | ||
| . ./build/Build.Common.ps1 | ||
| $tag = "v$(Get-SemVer)" | ||
| } finally { | ||
| Pop-Location | ||
| } | ||
|
|
||
| if ($env:GITHUB_OUTPUT) { | ||
| "tag=$tag" >> $env:GITHUB_OUTPUT | ||
| } | ||
|
|
||
| $isDraft = gh release view $tag --repo $Repo --json isDraft --jq .isDraft 2>$null | ||
| if ($LASTEXITCODE -eq 0) { | ||
| # A draft left by an earlier attempt of this run; refresh its assets. | ||
| if ($isDraft -ne 'true') { throw "Release $tag has already been published" } | ||
| Write-Host "Updating existing draft release $tag" | ||
| & gh release upload $tag --repo $Repo --clobber @assets | ||
| if ($LASTEXITCODE -ne 0) { throw "Uploading release assets failed" } | ||
| } else { | ||
| Write-Host "Creating draft release $tag" | ||
| $arguments = @('release', 'create', $tag, '--draft', '--title', $tag, '--target', $Target, '--generate-notes', '--repo', $Repo) | ||
| # Get-SemVer adds a prerelease suffix for every branch except `main`. | ||
| if ($tag.Contains('-')) { $arguments += '--prerelease' } | ||
| & gh @arguments @assets | ||
| if ($LASTEXITCODE -ne 0) { throw "Creating the draft release failed" } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.