Repository navigation
feat(release): J5 versions are dates, and a stable release is a promoted nightly #537
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
fefbfa6
feat(release): J5 versions are dates, and a stable release is a promo…
Jacksondr5 977dd31
docs(fork): the CI section describes date nightlies and stable promotion
Jacksondr5 c20c0de
fix(release): J5 Stable follows the single-run release, and promotion…
Jacksondr5 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
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,113 @@ | ||
| name: J5 Stable | ||
|
|
||
| # Promotes a published nightly to a stable release: the nightly's commit, built | ||
| # again as `<yyyymm>.<d>.<n>` (the nightly's version without its suffix) and | ||
| # published as "latest". The stable build is of a commit nightly users already | ||
| # ran. Nothing is committed: the version is stamped into the manifests during | ||
| # each build. J5 Release builds the desktop app and the CLI archives and | ||
| # publishes them. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| nightly: | ||
| description: Nightly to promote, such as v202610.15.0-nightly.20261015.12. Defaults to the newest. | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: {} | ||
|
|
||
| # Shared with J5 Nightly: a nightly picks its number before its builds, so a | ||
| # stable release of the same day published meanwhile would sort above it. | ||
| concurrency: | ||
| group: j5-publish | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| resolve: | ||
| name: Resolve the nightly and its stable version | ||
| if: github.repository == 'Jacksondr5/j5code' | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 10 | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| ref: ${{ steps.version.outputs.ref }} | ||
| version: ${{ steps.version.outputs.version }} | ||
| steps: | ||
| - name: Require the default branch | ||
| run: | | ||
| if [[ "$GITHUB_REF" != "refs/heads/j5/main" ]]; then | ||
| echo "::error::Run J5 Stable on j5/main, whose workflows it uses; this run was started on $GITHUB_REF." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
|
|
||
| - name: Resolve the nightly and its stable version | ||
| id: version | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| NIGHTLY: ${{ inputs.nightly }} | ||
| run: | | ||
| set -euo pipefail | ||
| tag="$NIGHTLY" | ||
| if [[ -z "$tag" ]]; then | ||
| tag="$(gh api "repos/$GITHUB_REPOSITORY/releases?per_page=100" \ | ||
| --jq '[.[] | select(.draft | not) | select(.tag_name | test("-nightly\\."))] | sort_by(.published_at) | last | .tag_name // empty')" | ||
| if [[ -z "$tag" ]]; then | ||
| echo "::error::No published nightly found. Run J5 Nightly first." | ||
| exit 1 | ||
| fi | ||
| fi | ||
| tag="v${tag#v}" | ||
| # A nightly that was never published was never offered to anyone to run. | ||
| if [[ "$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$tag" --jq '.draft')" != "false" ]]; then | ||
| echo "::error::$tag is not a published release." | ||
| exit 1 | ||
| fi | ||
| latest="$(gh api "repos/$GITHUB_REPOSITORY/releases/latest" --jq '.tag_name')" | ||
| version="$(node scripts/j5/release-version.ts stable "$tag" --latest "$latest")" | ||
| ref="$(gh api "repos/$GITHUB_REPOSITORY/commits/$tag" --jq '.sha')" | ||
| # Fail before the signed builds when another nightly already took this number. | ||
| if taken="$(gh api "repos/$GITHUB_REPOSITORY/commits/v$version" --jq '.sha' 2>/dev/null)" && [[ "$taken" != "$ref" ]]; then | ||
| echo "::error::v$version is already released from $taken, not $tag ($ref). Promote a newer nightly." | ||
| exit 1 | ||
| fi | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
| echo "ref=$ref" >> "$GITHUB_OUTPUT" | ||
| echo "::notice::Promoting $tag ($ref) to J5 Code $version." | ||
|
|
||
| # These gitlinks belong to vendored manifests, not this repository. | ||
| # Remove them only from the disposable index before checkout's cleanup. | ||
| - name: Exclude vendored gitlinks from checkout cleanup | ||
| if: always() | ||
| run: | | ||
| python3 - <<'PYTHON' | ||
| import subprocess | ||
| entries = subprocess.check_output(["git", "ls-files", "--stage", "-z", ".repos"]) | ||
| paths = [entry.split(b"\t", 1)[1] for entry in entries.split(b"\0") if entry.startswith(b"160000 ")] | ||
| if paths: | ||
| subprocess.run(["git", "update-index", "--force-remove", "-z", "--stdin"], input=b"\0".join(paths) + b"\0", check=True) | ||
| PYTHON | ||
|
|
||
| release: | ||
| name: Release | ||
| needs: resolve | ||
| permissions: | ||
| contents: write | ||
| actions: read | ||
| uses: ./.github/workflows/j5-release.yml | ||
| with: | ||
| ref: ${{ needs.resolve.outputs.ref }} | ||
| version: ${{ needs.resolve.outputs.version }} | ||
| secrets: | ||
| CSC_LINK: ${{ secrets.CSC_LINK }} | ||
| CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | ||
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | ||
| APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | ||
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | ||
Oops, something went wrong.
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.
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.
Small one. This only checks "older than latest". If
v$versionalready exists at a different commit, that only shows up in J5 Release's resolve, after we've paid for a full signed and notarized build. Could checkcommits/v$versionhere and fail early with "Promote a newer nightly".