ci: test workaround to immutable release issue on nightly (#1907)

Workaround is to create nightly as a draft and then use `gh` to manually publish it after. Also a lot of other small fixes.
This commit is contained in:
Clement Tsang
2025-12-20 21:34:11 -05:00
committed by GitHub
parent d7966473ea
commit 9b9262b3cb
3 changed files with 37 additions and 8 deletions
+34 -5
View File
@@ -76,22 +76,51 @@ jobs:
- name: Delete tag and release if not mock
if: github.event.inputs.isMock != 'true'
run: gh release delete nightly --cleanup-tag
run: |
while true; do
PREV_NIGHTLY=$(gh release list --json name,tagName | jq -c '[.[] | select (.tagName | contains("nightly-"))][0] | .tagName' | tr -d '"')
if [[ "$PREV_NIGHTLY" != "null" && "$PREV_NIGHTLY" == *"nightly-"* ]]; then
echo "Will delete nightly release with tag '$PREV_NIGHTLY'";
gh release delete $PREV_NIGHTLY --cleanup-tag || { echo "couldn't delete previous nightly release, halting"; break; }
else
echo "no nightly releases left, done";
break;
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sleep for a few seconds to prevent timing issues between the deletion and creation of the release
run: sleep 10
- name: Create and set tag name and release name
if: github.event.inputs.isMock != 'true'
run: |
COMMIT_HASH=$(git rev-parse --short=8 HEAD)
TIME=$(date +%s)
TAG_NAME=$(echo "nightly-$COMMIT_HASH-$TIME")
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
echo "$TAG_NAME"
DATE=$(date '+%Y-%m-%d')
RELEASE_NAME=$(echo "Nightly ($DATE)")
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
echo "$RELEASE_NAME"
# As a workaround to immutable releases, we create it as a draft first, then manually publish it after.
- name: Add all release files and create nightly release if not mock
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # 2.0.8
if: github.event.inputs.isMock != 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag_name: "nightly"
draft: false
tag_name: ${{ env.TAG_NAME }}
draft: true
fail_on_unmatched_files: true
name: ${{ env.RELEASE_NAME }}
files: |
./release/*
- name: Publish the draft release
if: github.event.inputs.isMock != 'true'
run: gh release edit "$TAG_NAME" --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+2 -2
View File
@@ -212,7 +212,7 @@ yay -S bottom-git
### Debian / Ubuntu
A `.deb` file is provided on each [stable release](https://github.com/ClementTsang/bottom/releases/latest) and
[nightly builds](https://github.com/ClementTsang/bottom/releases/tag/nightly) for x86, aarch64, and armv7.
[nightly builds](https://github.com/ClementTsang/bottom/releases) for x86, aarch64, and armv7.
Some examples of installing it this way:
```bash
@@ -413,7 +413,7 @@ mise use -g bottom@latest
You can also use the pre-built release binaries:
- [Latest stable release](https://github.com/ClementTsang/bottom/releases/latest), built using the release branch
- [Latest nightly release](https://github.com/ClementTsang/bottom/releases/tag/nightly), built using the `main` branch at 00:00 UTC daily
- [Latest nightly release](https://github.com/ClementTsang/bottom/releases), built using the `main` branch at 00:00 UTC daily
To use, download and extract the binary that matches your system. You can then run by doing:
@@ -12,7 +12,7 @@
bottom currently has two main deploy processes to worry about:
- [Nightly](https://github.com/ClementTsang/bottom/blob/main/.github/workflows/nightly.yml): a daily (00:00 UTC) GitHub action to build binary/installer files, and upload them to the [nightly release](https://github.com/ClementTsang/bottom/releases/tag/nightly). It can also be triggered manually as either a proper nightly release or a mock release.
- [Nightly](https://github.com/ClementTsang/bottom/blob/main/.github/workflows/nightly.yml): a daily (00:00 UTC) GitHub action to build binary/installer files, and upload them to the [nightly release](https://github.com/ClementTsang/bottom/releases). It can also be triggered manually as either a proper nightly release or a mock release.
- [Stable](https://github.com/ClementTsang/bottom/blob/main/.github/workflows/deployment.yml): a stable deployment, triggered manually or upon creation of a valid tag. This is a GitHub action that builds binary/installer files and uploads them to a new GitHub release.
Furthermore, this workflow does not handle the following deployments, which must be manually handled: