mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-10-15 09:06:14 -08:00
ci: publish rolling nightly releases with build deduplication (#2692)
* ci: publish rolling main nightly builds and retry failed jobs Keep one nightly prerelease with stable artifact filenames. Publish only successful Core, GUI, Mobile and Test runs from the same main commit, and prevent older runs from replacing a newer nightly. Generate dated changes against the latest published version release, including manual prereleases, in newest-first order. Link the fixed nightly download page from both READMEs. Retry failed full-build jobs once on main and develop, excluding cancelled runs and attempts after the first. Validated with 28 Node tests, actionlint, archive packaging checks, and read-only selection of real GitHub builds and release notes.
This commit is contained in:
1 parent
03078b4791
commit
36b4ffcc74
9 files changed
+617
-8
No files matched your search
@@ -0,0 +1,97 @@
|
||||
name: EasyTier Nightly Release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
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
|
||||
with:
|
||||
script: |
|
||||
const fs = require('node:fs');
|
||||
const { prepare } = require('./.github/scripts/nightly-release.js');
|
||||
const build = await prepare({ github, context, core });
|
||||
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' });
|
||||
@@ -0,0 +1,28 @@
|
||||
name: EasyTier Nightly Retry
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [EasyTier Core, EasyTier GUI, EasyTier Mobile, EasyTier Test]
|
||||
branches: [main]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
retry:
|
||||
if: >-
|
||||
github.event.workflow_run.event == 'workflow_dispatch' &&
|
||||
github.event.workflow_run.conclusion == 'failure' &&
|
||||
github.event.workflow_run.run_attempt == 1 &&
|
||||
github.event.workflow_run.head_repository.full_name == github.repository
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Retry failed jobs once
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
await github.rest.actions.reRunWorkflowFailedJobs({
|
||||
...context.repo,
|
||||
run_id: context.payload.workflow_run.id,
|
||||
});
|
||||
@@ -16,6 +16,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
@@ -26,3 +27,10 @@ jobs:
|
||||
script: |
|
||||
const dispatch = require('./.github/scripts/nightly-build.js');
|
||||
await dispatch({ github, context, core });
|
||||
|
||||
release:
|
||||
needs: dispatch
|
||||
permissions:
|
||||
actions: read
|
||||
contents: write
|
||||
uses: ./.github/workflows/nightly-release.yml
|
||||
Reference in new issue
Block a user