Skip to content

Commit

Permalink
MAINT Fix cross-build metadata update workflow, open issue on failures (
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal authored and hoodmane committed Nov 14, 2024
1 parent acff395 commit 30c4fe8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
48 changes: 30 additions & 18 deletions .github/workflows/update_cross_build_releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ on:
workflow_dispatch:
inputs:
version:
description: "Version number"
description: "Version number to update to. This should not contain the 'v' prefix, since our releases on GitHub do not have it."
required: true

env:
version: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.version }}

jobs:
update_cross_build_releases:
runs-on: ubuntu-latest
Expand All @@ -25,32 +28,41 @@ jobs:
python -m pip install --upgrade pip
pip install ./pyodide-build
- name: Get version number (release)
if: github.event_name == 'release'
run: |
echo "VERSION=${{ github.event.release.name }}" >> $GITHUB_ENV
- name: Get version number (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Update cross-build metadata file
id: update_cross_build_metadata
working-directory: tools
run: |
python update_cross_build_releases.py "${{ env.VERSION }}"
python update_cross_build_releases.py "${{ env.version }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update cross-build metadata file for version ${{ env.VERSION }} [skip ci]
title: Update cross-build metadata file for version ${{ env.VERSION }}
commit-message: Update cross-build metadata file for version ${{ env.version }} [skip ci]
title: Update cross-build metadata file for version ${{ env.version }}
body: |
This PR updates the cross-build metadata file for version ${{ env.VERSION }}
branch: update-cross-build-metadata-${{ env.VERSION }}
This PR updates the cross-build metadata file for the new version ${{ env.version }}.
Requesting a review from the @pyodide/core team.
branch: update-cross-build-metadata-${{ env.version }}
base: main
branch-suffix: timestamp
draft: true
add-paths: |
pyodide-cross-build-environments.json

- name: Create an issue if the update fails
if: failure() || steps.update_cross_build_metadata.outcome == 'failure'
uses: dacbd/create-issue-action@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Update cross-build metadata file for version ${{ env.VERSION }} failed
body: |
## Description
The update of the cross-build metadata file for version ${{ env.VERSION }} failed.
## Additional information
Please check the logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
for more information and update the metadata file manually if necessary.
labels:
assignees: ${{ github.actor }}
1 change: 1 addition & 0 deletions tools/update_cross_build_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
CrossBuildEnvReleaseSpec,
)

# This file must be called from the root of the repository for the path to work
METADATA_FILE = Path(__file__).parents[1] / "pyodide-cross-build-environments.json"

BASE_URL = "https://github.com/pyodide/pyodide/releases/download/{version}/xbuildenv-{version}.tar.bz2"
Expand Down

0 comments on commit 30c4fe8

Please sign in to comment.