Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Nightly Release

on:
schedule:
- cron: "0 6 * * *" # 06:00 UTC daily
workflow_dispatch:

permissions:
contents: write

Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This workflow can be triggered by both the daily schedule and workflow_dispatch. Without a concurrency group, two runs can overlap and race while creating/pushing the same tag (one run may fail with “tag already exists” after the other pushes). Add a concurrency block (similar to .github/workflows/e2e.yml) to ensure only one nightly-tag job runs at a time.

Suggested change
concurrency:
group: nightly-release-${{ github.ref }}
cancel-in-progress: true

Copilot uses AI. Check for mistakes.
jobs:
create-nightly-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Create nightly tag if new commits exist
run: |
LAST_NIGHTLY=$(git tag -l 'v*-nightly.*' --sort=-v:refname | head -1)
if [ -n "$LAST_NIGHTLY" ]; then
COMMITS=$(git rev-list "${LAST_NIGHTLY}..HEAD" --count)
if [ "$COMMITS" -eq 0 ]; then
echo "No new commits since ${LAST_NIGHTLY}, skipping."
exit 0
fi
fi

LATEST_STABLE=$(git describe --tags --abbrev=0 --match 'v[0-9]*' --exclude '*-*' 2>/dev/null)
Copy link
Copy Markdown
Member

@pjbgf pjbgf Apr 1, 2026

Choose a reason for hiding this comment

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

Not sure if we want current stable or current stable +1 patch. Because:

v0.5.0-nightly < v0.5.0 < v0.5.1

So if the current release is v0.5.0, semver wise I think the nightly would be v0.5.1-nightly... so that:

v0.5.0 < v0.5.1-nightly < v0.5.1

if [ -z "$LATEST_STABLE" ]; then
echo "::error::No stable version tag found"
exit 1
fi

DATE=$(date -u +%Y%m%d)
TAG="${LATEST_STABLE}-nightly.${DATE}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shall we also add the short hash to it?

Suggested change
TAG="${LATEST_STABLE}-nightly.${DATE}"
TAG="${LATEST_STABLE}-nightly.${DATE}.${SHORT_COMMIT_ID}"


if git rev-parse "${TAG}" >/dev/null 2>&1; then
echo "Tag ${TAG} already exists, skipping."
exit 0
fi

echo "Creating nightly tag: ${TAG}"
git tag "${TAG}"
git push origin "${TAG}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nightly tag push won't trigger release workflow

High Severity

The nightly workflow pushes tags using the default GITHUB_TOKEN (from actions/checkout), but GitHub Actions deliberately prevents events triggered by GITHUB_TOKEN from creating new workflow runs. This means the git push origin "${TAG}" will never trigger the release workflow's push: tags trigger, making the entire nightly release pipeline non-functional. A PAT or GitHub App token is needed for the checkout/push step.

Additional Locations (1)
Fix in Cursor Fix in Web

24 changes: 19 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,27 @@ jobs:
homebrew-tap
scoop-bucket

- name: Extract release notes from CHANGELOG.md
- name: Extract release notes
run: |
VERSION="${GITHUB_REF_NAME#v}"
awk -v ver="$VERSION" 'BEGIN{header="^## \\[" ver "\\]"} $0 ~ header{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md > "$RUNNER_TEMP/release_notes.md"
if [ ! -s "$RUNNER_TEMP/release_notes.md" ]; then
echo "::error::No changelog entry found for version ${VERSION} in CHANGELOG.md"
exit 1

if [[ "$VERSION" == *-* ]]; then
# Prerelease (nightly): generate notes from git log
LATEST_STABLE=$(git describe --tags --abbrev=0 --match 'v[0-9]*' --exclude '*-*' HEAD^ 2>/dev/null || echo "")
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

For prerelease tags, git describe ... HEAD^ can select the previous stable tag when the nightly tag is created on the same commit as the latest stable release (e.g., right after cutting a stable release with no new commits). That would make the generated “Changes since …” section incorrect. Consider deriving the stable base tag directly from the prerelease tag name (e.g., strip the -nightly.* suffix) or run git describe against HEAD (relying on --exclude '*-*') so the latest stable tag is used consistently.

Suggested change
LATEST_STABLE=$(git describe --tags --abbrev=0 --match 'v[0-9]*' --exclude '*-*' HEAD^ 2>/dev/null || echo "")
LATEST_STABLE=$(git describe --tags --abbrev=0 --match 'v[0-9]*' --exclude '*-*' HEAD 2>/dev/null || echo "")

Copilot uses AI. Check for mistakes.
echo "## Nightly Build (${GITHUB_REF_NAME})" > "$RUNNER_TEMP/release_notes.md"
echo "" >> "$RUNNER_TEMP/release_notes.md"
if [ -n "$LATEST_STABLE" ]; then
echo "Changes since ${LATEST_STABLE}:" >> "$RUNNER_TEMP/release_notes.md"
echo "" >> "$RUNNER_TEMP/release_notes.md"
git log --oneline "${LATEST_STABLE}..HEAD" --no-merges >> "$RUNNER_TEMP/release_notes.md"
fi
else
# Stable release: require CHANGELOG entry
awk -v ver="$VERSION" 'BEGIN{header="^## \\[" ver "\\]"} $0 ~ header{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md > "$RUNNER_TEMP/release_notes.md"
if [ ! -s "$RUNNER_TEMP/release_notes.md" ]; then
echo "::error::No changelog entry found for version ${VERSION} in CHANGELOG.md"
exit 1
fi
fi

- name: Run GoReleaser
Expand Down
30 changes: 29 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ scoops:
homepage: "https://github.com/entireio/cli"
description: "CLI for Entire"
license: MIT
skip_upload: '{{ if .Prerelease }}true{{ end }}'

- name: entire-nightly
repository:
owner: entireio
name: scoop-bucket
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
homepage: "https://github.com/entireio/cli"
description: "CLI for Entire (nightly build)"
license: MIT
skip_upload: '{{ if not .Prerelease }}true{{ end }}'

homebrew_casks:
- name: entire
Expand All @@ -91,9 +102,26 @@ homebrew_casks:
bash: "completions/entire.bash"
zsh: "completions/entire.zsh"
fish: "completions/entire.fish"
skip_upload: '{{ if .Prerelease }}true{{ end }}'

- name: entire-nightly
repository:
owner: entireio
name: homebrew-tap
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
directory: Casks
homepage: "https://github.com/entireio/cli"
description: "CLI for Entire (nightly build)"
binaries:
- entire
completions:
bash: "completions/entire.bash"
zsh: "completions/entire.zsh"
fish: "completions/entire.fish"
skip_upload: '{{ if not .Prerelease }}true{{ end }}'

announce:
discord:
enabled: '{{ and (isEnvSet "DISCORD_WEBHOOK_ID") (isEnvSet "DISCORD_WEBHOOK_TOKEN") }}'
enabled: '{{ and (not .Prerelease) (isEnvSet "DISCORD_WEBHOOK_ID") (isEnvSet "DISCORD_WEBHOOK_TOKEN") }}'
message_template: "Beep, boop. **Entire CLI {{ .Tag }}** is out!\n\n{{ .ReleaseURL }}\n\nSee https://docs.entire.io/cli/installation for help installing and updating."
author: "Entire"
Loading