Skip to content
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
5 changes: 1 addition & 4 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ description: build standalone executables using PyInstaller
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
- 'master'
workflow_dispatch:

jobs:
Expand Down
39 changes: 32 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,42 @@ jobs:
id: get_run_id
run: |
run_id=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${OWNER}/${REPO_NAME}/actions/workflows/binaries.yml/runs?status=success" | \
jq -r '.workflow_runs|sort_by(.updated_at)[-1].id')
"https://api.github.com/repos/${{ github.repository }}/actions/workflows/binaries.yml/runs?status=success&per_page=1" | \
jq -r '.workflow_runs[0].id')
if [ -z "$run_id" ] || [ "$run_id" = "null" ]; then
printf >&2 'No successful workflow runs found for binaries.yml. Cannot create release.\n'
exit 1
fi
printf 'run_id=%s\n' "$run_id" >>"$GITHUB_OUTPUT"
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
run-id: ${{ steps.get_run_id.outputs.run_id }}
- name: Create Release
uses: softprops/action-gh-release@v2
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive artifacts
run: |
cd artifacts || {
printf >&2 'No artifacts directory. Cannot create release.\n';
exit 1
}
found=0
for dir in */; do
if [ -n "$(ls -A "$dir" 2>/dev/null)" ]; then
(cd "$dir" && zip -r "../${dir%/}.zip" .) || { echo "Failed to create zip for $dir"; exit 1; }
found=1
else
echo "Skipping $dir: directory is empty"
fi
done
if [ $found -eq 0 ]; then
printf >&2 'No files to archive. Cannot create release.\n'
exit 1
fi
- name: Create release and upload assets
id: create_release
uses: ncipollo/release-action@v1
with:
files: ./artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "artifacts/*.zip"
tag: ${{ github.ref_name }}