Skip to content

add workflow to create release from a given Actions run #10

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

Merged
merged 3 commits into from
Aug 15, 2025
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/rebuildDependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths-ignore:
- README.md
- .github/workflows/releaseFromRun.yml
workflow_dispatch:

jobs:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/releaseFromRun.yml
Original file line number Diff line number Diff line change
@@ -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-*"
Comment on lines +18 to +26
Copy link
Member

Choose a reason for hiding this comment

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

I think we can also use download-artifact action here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

true, but with CLI tool it's shorter


- 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"""

<details><summary><b>{packageListPath.stem.removeprefix("dependencies-")}</b> packages</summary>

{open(packageListPath, "r").read()}
</details>"""

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)
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Loading