Skip to content

Commit 93707b5

Browse files
committed
Use nightly rolling build release
1 parent 531088b commit 93707b5

4 files changed

Lines changed: 65 additions & 17 deletions

File tree

.github/workflows/build.yml

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
name: build (manual)
22

33
# Manual builds of `pie` for distribution. Each run rewrites the
4-
# `latest-build` rolling pre-release on this repo's GitHub Releases —
4+
# `nightly` rolling pre-release on this repo's GitHub Releases —
55
# every artifact is uploaded with `gh release upload --clobber`, so
66
# download URLs stay stable across runs.
77
#
8-
# One-time setup before the first dispatch:
9-
#
10-
# gh release create latest-build --prerelease --notes "Rolling build"
11-
#
12-
# After that, this workflow keeps the assets on that release fresh.
8+
# The prepare-release job creates the release if needed before any
9+
# matrix jobs start uploading assets.
1310

1411
on:
1512
workflow_dispatch:
1613
inputs:
1714
tag:
1815
description: "Release tag to update (assets uploaded with --clobber)"
1916
type: string
20-
default: "latest-build"
17+
default: "nightly"
2118
portable:
2219
description: "Build portable matrix (manylinux x86_64/aarch64 + macOS arm64 + Windows x86_64 Vulkan/CUDA)"
2320
type: boolean
@@ -42,11 +39,50 @@ env:
4239
Workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
4340
4441
jobs:
42+
# =========================================================================
43+
# Create/update the rolling release before any matrix job tries to upload.
44+
# This keeps `gh release upload` from racing a missing release, and keeps
45+
# the rolling build out of GitHub's "Latest" release slot.
46+
# =========================================================================
47+
prepare-release:
48+
if: inputs.portable || inputs.cuda || inputs.cuda_manylinux
49+
runs-on: ubuntu-latest
50+
permissions:
51+
contents: write
52+
steps:
53+
- name: Ensure rolling release exists
54+
env:
55+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
TAG: ${{ inputs.tag }}
57+
run: |
58+
set -euxo pipefail
59+
if gh release view "${TAG}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
60+
release_id="$(gh release view "${TAG}" --json databaseId --jq .databaseId --repo "${GITHUB_REPOSITORY}")"
61+
gh api \
62+
-X PATCH \
63+
"repos/${GITHUB_REPOSITORY}/releases/${release_id}" \
64+
-f tag_name="${TAG}" \
65+
-f name="${TAG}" \
66+
-f body="${RELEASE_NOTES}" \
67+
-F draft=false \
68+
-F prerelease=true \
69+
-f make_latest=false
70+
else
71+
gh release create "${TAG}" \
72+
--repo "${GITHUB_REPOSITORY}" \
73+
--target "${GITHUB_SHA}" \
74+
--title "${TAG}" \
75+
--notes "${RELEASE_NOTES}" \
76+
--prerelease \
77+
--latest=false
78+
fi
79+
4580
# =========================================================================
4681
# Portable matrix — CPU/Metal/Vulkan plus Windows portable CUDA.
4782
# =========================================================================
4883
portable:
4984
if: inputs.portable
85+
needs: prepare-release
5086
name: portable / ${{ matrix.target.label }}
5187
strategy:
5288
fail-fast: false
@@ -301,6 +337,7 @@ jobs:
301337
# =========================================================================
302338
cuda:
303339
if: inputs.cuda
340+
needs: prepare-release
304341
name: cuda / linux-x64 / ${{ matrix.flavor.id }}-${{ matrix.cuda.short }}
305342
runs-on: [self-hosted, linux, x64, gpu, cuda]
306343
strategy:
@@ -441,6 +478,7 @@ jobs:
441478
tag_name: ${{ inputs.tag }}
442479
files: dist/${{ env.ARTIFACT_NAME }}
443480
fail_on_unmatched_files: true
481+
make_latest: false
444482

445483
# =========================================================================
446484
# CUDA matrix on GH-hosted runners with manylinux_2_28 base — produces
@@ -454,6 +492,7 @@ jobs:
454492
# =========================================================================
455493
cuda-manylinux:
456494
if: inputs.cuda_manylinux
495+
needs: prepare-release
457496
name: cuda / x86_64-manylinux_2_28 / ${{ matrix.flavor.id }}-${{ matrix.cuda.short }}
458497
runs-on: ubuntu-22.04
459498
timeout-minutes: 120
@@ -548,6 +587,7 @@ jobs:
548587
tag_name: ${{ inputs.tag }}
549588
files: dist/${{ env.ARTIFACT_NAME }}
550589
fail_on_unmatched_files: true
590+
make_latest: false
551591

552592
# =========================================================================
553593
# Refresh the release notes once after all builds finish.
@@ -562,8 +602,16 @@ jobs:
562602
- name: Edit release notes + body
563603
env:
564604
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
605+
TAG: ${{ inputs.tag }}
565606
run: |
566607
set -euxo pipefail
567-
gh release edit "${{ inputs.tag }}" \
568-
--notes "${RELEASE_NOTES}" \
569-
--repo "${{ github.repository }}"
608+
release_id="$(gh release view "${TAG}" --json databaseId --jq .databaseId --repo "${GITHUB_REPOSITORY}")"
609+
gh api \
610+
-X PATCH \
611+
"repos/${GITHUB_REPOSITORY}/releases/${release_id}" \
612+
-f tag_name="${TAG}" \
613+
-f name="${TAG}" \
614+
-f body="${RELEASE_NOTES}" \
615+
-F draft=false \
616+
-F prerelease=true \
617+
-f make_latest=false

scripts/install.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#
33
# irm https://pie-project.org/install.ps1 | iex
44
# $env:PIE_FLAVOR = "portable-cuda"; irm https://pie-project.org/install.ps1 | iex
5-
# $env:PIE_VERSION = "v0.1.2"; irm https://pie-project.org/install.ps1 | iex
5+
# $env:PIE_VERSION = "0.3.0"; irm https://pie-project.org/install.ps1 | iex
66
#
77
# Environment overrides:
8-
# PIE_VERSION Release tag (default: latest-build).
8+
# PIE_VERSION Release tag (default: nightly).
99
# PIE_FLAVOR portable-vulkan | portable-cuda (default: portable-vulkan).
1010
# PIE_INSTALL_DIR Install location for pie.exe (default: %LOCALAPPDATA%\Pie\bin).
1111
# PIE_REPO GitHub owner/name (default: pie-project/pie).
@@ -139,7 +139,7 @@ if ($machineArch -notin @("AMD64", "x86_64")) {
139139
}
140140

141141
$repo = Get-EnvOrDefault "PIE_REPO" "pie-project/pie"
142-
$version = Get-EnvOrDefault "PIE_VERSION" "latest-build"
142+
$version = Get-EnvOrDefault "PIE_VERSION" "nightly"
143143
$installDir = Get-EnvOrDefault "PIE_INSTALL_DIR" (Join-Path $env:LOCALAPPDATA "Pie\bin")
144144
$downloadBase = Get-EnvOrDefault "PIE_DOWNLOAD_BASE" "https://github.com/$repo/releases/download/$version"
145145
$flavor = Get-EnvOrDefault "PIE_FLAVOR" "portable-vulkan"

scripts/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#
44
# curl -fsSL https://pie-project.org/install.sh | bash
55
# curl -fsSL https://pie-project.org/install.sh | PIE_FLAVOR=cuda12.8 bash
6-
# curl -fsSL https://pie-project.org/install.sh | PIE_VERSION=v0.1.2 bash
6+
# curl -fsSL https://pie-project.org/install.sh | PIE_VERSION=0.3.0 bash
77
#
88
# Environment overrides:
9-
# PIE_VERSION Release tag (default: latest-build).
9+
# PIE_VERSION Release tag (default: nightly).
1010
# PIE_FLAVOR portable | cuda{12.6,12.8,13.0}
1111
# | portable-cuda{12.6,12.8,13.0}. Auto-detected when unset.
1212
# PIE_INSTALL_DIR Install location for the `pie` binary (default: ~/.local/bin).
@@ -16,7 +16,7 @@
1616
set -euo pipefail
1717

1818
PIE_REPO="${PIE_REPO:-pie-project/pie}"
19-
PIE_VERSION="${PIE_VERSION:-latest-build}"
19+
PIE_VERSION="${PIE_VERSION:-nightly}"
2020
PIE_INSTALL_DIR="${PIE_INSTALL_DIR:-${HOME}/.local/bin}"
2121
PIE_DOWNLOAD_BASE="${PIE_DOWNLOAD_BASE:-https://github.com/${PIE_REPO}/releases/download/${PIE_VERSION}}"
2222
PIE_DETECTED_FLAVOR=""

website/docs/guide/install.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ curl -fsSL https://pie-project.org/install.sh | PIE_INSTALL_DIR=/usr/local/bin b
116116
### Install a specific version
117117

118118
```bash
119-
curl -fsSL https://pie-project.org/install.sh | PIE_VERSION=v0.1.2 bash
119+
curl -fsSL https://pie-project.org/install.sh | PIE_VERSION=0.3.0 bash
120120
```
121121

122122
### Install from source

0 commit comments

Comments
 (0)