From b810197c9195eb6ed6eb6d62f2b5d53adc72fda8 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 7 Aug 2025 12:25:19 +0300 Subject: [PATCH 1/3] add workflow to create release from a given Actions run --- .github/workflows/releaseFromRun.yml | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/releaseFromRun.yml diff --git a/.github/workflows/releaseFromRun.yml b/.github/workflows/releaseFromRun.yml new file mode 100644 index 0000000..b2774f2 --- /dev/null +++ b/.github/workflows/releaseFromRun.yml @@ -0,0 +1,54 @@ +name: Create release from Actions run +on: + workflow_dispatch: + inputs: + run_id: + description: 'Actions run ID which to get artifacts from' + required: true + type: number +jobs: + build: + runs-on: ubuntu-latest + env: + LISTS_DIR: lists + DEPENDENCIES_DIR: deps + GH_TOKEN: ${{ github.token }} + steps: + - name: Download artifacts + run: | + gh run download ${{ github.event.inputs.run_id }} \ + --repo ${{ github.repository }} \ + --dir "$LISTS_DIR" \ + --pattern "list of*" + gh run download ${{ github.event.inputs.run_id }} \ + --repo ${{ github.repository }} \ + --dir "$DEPENDENCIES_DIR" \ + --pattern "dependencies-*" + + - name: Create release + shell: python + run: | + from datetime import date + from glob import glob + from os import getenv + from pathlib import Path + from subprocess import run + + releaseNotes = "Generated from [this](https://github.com/${{ github.repository }}/actions/runs/${{ github.event.inputs.run_id }}) Actions run" + for packageListPath in sorted(Path(".").glob(f"{getenv("LISTS_DIR")}/**/*.txt")): + releaseNotes += f""" + +
{packageListPath.stem.removeprefix("dependencies-")} packages + + {open(packageListPath, "r").read()} +
""" + + tag = str(date.today()) + dependencies = glob(f"{getenv("DEPENDENCIES_DIR")}/**/*.tgz") + run([ + "gh", "release", "create", tag, + "--repo", "${{ github.repository }}", + "--prerelease", + "--title", tag, + "--notes", releaseNotes, + ] + dependencies, check=True) From bef5d912edc06f0f2a0ee1f5f9e4d203bfec2180 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 7 Aug 2025 13:08:17 +0300 Subject: [PATCH 2/3] don't run dependencies workflow on editing release workflow --- .github/workflows/rebuildDependencies.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rebuildDependencies.yml b/.github/workflows/rebuildDependencies.yml index 6f051fa..82c14cc 100644 --- a/.github/workflows/rebuildDependencies.yml +++ b/.github/workflows/rebuildDependencies.yml @@ -4,6 +4,7 @@ on: pull_request: paths-ignore: - README.md + - .github/workflows/releaseFromRun.yml workflow_dispatch: jobs: From b723804c33a3bac0a79c7f5df3ce492677adddfe Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 7 Aug 2025 13:08:23 +0300 Subject: [PATCH 3/3] update readme --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 45f0714..1db7d17 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Current flow to update dependencies: 1. Open PR with changes 2. Make sure that CI build succeeds 3. Merge the PR -4. (TBD) Run workflow to create new release from the CI run +4. Run workflow to create new release from the CI run 5. (TBD) Update dependencies submodule and prebuilts URL in VCMI repo to point to the new commit / release, update VCMI code if needed # TODO List @@ -19,5 +19,3 @@ Current flow to update dependencies: - Rebuild ffmpeg with libdav1d and av1 support enabled. Needs investigation as to why dav1d fails to build on mingw and on android. - Run CI with full package rebuild on schedule (weekly? monthly?) to detect any regressions or breaking changes in CI or in used recipes - -- (shouldn't be needed probably) Automatically generate Github release with updated packages as part of CI. Should probably be done only for changes in main branch and/or for manually triggered workflows