mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-10-15 00:56:15 -08:00
GITHUB_TOKEN-dispatched builds do not trigger downstream workflow_run jobs. The nightly release check ran before builds finished and then exited successfully without publishing anything. Track dispatch run IDs and wait for all missing components to succeed. Retry failed jobs once, account for delayed rerun state, and fail on terminal errors. Bound the build and wait job to three hours. Pass the built commit to publication so later main commits do not change the release target. Retain component deduplication and manual build completion handlers, and document the nightly lifecycle. Add regression coverage for pending builds, retries, terminal failures, dispatch races, and main advancing before publication. All 34 Node tests and actionlint for the three nightly workflows pass.
105 lines
3.9 KiB
YAML
105 lines
3.9 KiB
YAML
name: EasyTier Nightly Release
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
sha:
|
|
description: Commit whose full builds the caller has waited for
|
|
required: true
|
|
type: string
|
|
workflow_run:
|
|
workflows: [EasyTier Core, EasyTier GUI, EasyTier Mobile, EasyTier Test]
|
|
branches: [main]
|
|
types: [completed]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: easytier-nightly-release
|
|
cancel-in-progress: false
|
|
|
|
permissions:
|
|
actions: read
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
if: >-
|
|
((github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') &&
|
|
github.ref == 'refs/heads/main') ||
|
|
(github.event.workflow_run.event == 'workflow_dispatch' &&
|
|
github.event.workflow_run.conclusion == 'success' &&
|
|
github.event.workflow_run.head_repository.full_name == github.repository)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
ref: main
|
|
|
|
- name: Select complete main builds and prepare release notes
|
|
id: prepare
|
|
uses: actions/github-script@v8
|
|
env:
|
|
BUILD_SHA: ${{ inputs.sha }}
|
|
with:
|
|
script: |
|
|
const fs = require('node:fs');
|
|
const { prepare } = require('./.github/scripts/nightly-release.js');
|
|
const build = await prepare({ github, context, core, sha: process.env.BUILD_SHA });
|
|
if (!build) return;
|
|
fs.writeFileSync('nightly-release.json', JSON.stringify(build));
|
|
for (const workflow of ['core', 'gui', 'mobile']) {
|
|
core.setOutput(`${workflow}_run_id`, build.runs[workflow]);
|
|
core.setOutput(`${workflow}_artifact_ids`, build.artifacts[workflow].map(a => a.id).join(','));
|
|
// download-artifact extracts a single artifact directly into path.
|
|
const suffix = build.artifacts[workflow].length === 1 ? `/${build.artifacts[workflow][0].name}` : '';
|
|
core.setOutput(`${workflow}_path`, `nightly-artifacts${suffix}`);
|
|
}
|
|
core.setOutput('ready', 'true');
|
|
|
|
- name: Download Core artifacts
|
|
if: steps.prepare.outputs.ready == 'true'
|
|
uses: actions/download-artifact@v5
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
run-id: ${{ steps.prepare.outputs.core_run_id }}
|
|
artifact-ids: ${{ steps.prepare.outputs.core_artifact_ids }}
|
|
path: ${{ steps.prepare.outputs.core_path }}
|
|
|
|
- name: Download GUI artifacts
|
|
if: steps.prepare.outputs.ready == 'true'
|
|
uses: actions/download-artifact@v5
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
run-id: ${{ steps.prepare.outputs.gui_run_id }}
|
|
artifact-ids: ${{ steps.prepare.outputs.gui_artifact_ids }}
|
|
path: ${{ steps.prepare.outputs.gui_path }}
|
|
|
|
- name: Download Mobile artifacts
|
|
if: steps.prepare.outputs.ready == 'true'
|
|
uses: actions/download-artifact@v5
|
|
with:
|
|
github-token: ${{ github.token }}
|
|
run-id: ${{ steps.prepare.outputs.mobile_run_id }}
|
|
artifact-ids: ${{ steps.prepare.outputs.mobile_artifact_ids }}
|
|
path: ${{ steps.prepare.outputs.mobile_path }}
|
|
|
|
- name: Package assets with stable names
|
|
if: steps.prepare.outputs.ready == 'true'
|
|
shell: bash
|
|
run: |
|
|
mkdir nightly-assets
|
|
chmod -R 755 nightly-artifacts
|
|
for artifact in nightly-artifacts/*; do
|
|
name=$(basename "$artifact")
|
|
(cd "$artifact" && zip -qr "$GITHUB_WORKSPACE/nightly-assets/$name.zip" .)
|
|
done
|
|
|
|
- name: Update the fixed nightly prerelease
|
|
if: steps.prepare.outputs.ready == 'true'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const { publish } = require('./.github/scripts/nightly-release.js');
|
|
const build = require(`${process.env.GITHUB_WORKSPACE}/nightly-release.json`);
|
|
await publish({ github, context, core, build, directory: 'nightly-assets' });
|