Merge branch 'fix/remix-dependency-bot-ci' into 'main' #276
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Download RTX Remix Toolkit Package | |
| run-name: '${{ github.event.client_payload.commit_title }}' | |
| on: | |
| repository_dispatch: | |
| types: [trigger-toolkit-download] | |
| jobs: | |
| rtx-remix-toolkit-windows-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Remove unnecessary files and programs to avoid running out of disk space in the runner | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf \ | |
| /usr/local/aws-cli \ | |
| /usr/local/aws-sam-cli \ | |
| /usr/local/julia1.12.2 \ | |
| /usr/local/lib/android \ | |
| /usr/local/lib/heroku \ | |
| /usr/local/lib/node_modules \ | |
| /opt/hostedtoolcache/CodeQL \ | |
| /opt/hostedtoolcache/go \ | |
| /opt/hostedtoolcache/PyPy \ | |
| /opt/hostedtoolcache/node \ | |
| /usr/local/bin/oc \ | |
| /usr/local/share/chromium \ | |
| /usr/local/share/powershell \ | |
| /opt/az \ | |
| /opt/microsoft/msedge \ | |
| /opt/microsoft/powershell | |
| sudo apt purge -y firefox google-chrome-stable microsoft-edge-stable | |
| - name: Checkout public mirror repository | |
| # client_payload.commit_sha is the GitLab source SHA used for Packman | |
| # artifact naming. Filtered GitHub history may use a different public SHA. | |
| uses: actions/checkout@v6 | |
| - name: Download package | |
| run: | | |
| # Read version from the GitLab source commit that published the package. | |
| VERSION="${{ github.event.client_payload.version }}" | |
| if [ -z "$VERSION" ]; then | |
| echo "::error::client_payload.version is required" | |
| exit 1 | |
| fi | |
| # Get branch name and GitLab source SHA for Packman package naming. | |
| BRANCH_NAME="${{ github.event.client_payload.ref || github.ref_name }}" | |
| COMMIT_SHA="${{ github.event.client_payload.commit_sha || github.sha }}" | |
| SHORT_SHA="${COMMIT_SHA:0:8}" | |
| # Normalize branch name: release/* -> release | |
| [[ "$BRANCH_NAME" == release/* ]] && BRANCH_NAME="release" | |
| # Construct the filename | |
| FILENAME="rtx_remix@${VERSION}+${BRANCH_NAME}.${SHORT_SHA}.gl.windows-x86_64.release" | |
| echo "Downloading package: $FILENAME" | |
| echo "Version: $VERSION, Branch: $BRANCH_NAME, SHA: $SHORT_SHA" | |
| # Create project.xml for packman pull | |
| cat > project.xml << EOF | |
| <project toolsVersion="7.6"> | |
| <dependency name="rtx_remix" copyPath="_artifacts/${FILENAME}"> | |
| <package name="rtx_remix" version="${VERSION}+${BRANCH_NAME}.${SHORT_SHA}.gl.windows-x86_64.release" /> | |
| </dependency> | |
| </project> | |
| EOF | |
| # Download from packman using project.xml | |
| if ./tools/packman/packman pull project.xml; then | |
| echo "✅ Successfully downloaded $FILENAME" | |
| echo "SHOULD_UPLOAD=true" >> $GITHUB_ENV | |
| echo "FILENAME=$FILENAME" >> $GITHUB_ENV | |
| else | |
| echo "❌ Failed to download $FILENAME from packman" | |
| echo "SHOULD_UPLOAD=false" >> $GITHUB_ENV | |
| exit 1 | |
| fi | |
| - name: Upload artifact | |
| if: env.SHOULD_UPLOAD == 'true' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.FILENAME }} | |
| path: _artifacts/${{ env.FILENAME }} | |
| notify-slack-on-failure: | |
| runs-on: ubuntu-latest | |
| needs: rtx-remix-toolkit-windows-release | |
| if: ${{ failure() }} | |
| steps: | |
| - name: Notify Slack | |
| uses: slackapi/slack-github-action@v3 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| text: "Toolkit package workflow failed for ${{ github.repository }}" | |
| blocks: | |
| - type: section | |
| text: | |
| type: mrkdwn | |
| text: ":rotating-light-red: *Toolkit package workflow failed* for `${{ github.repository }}`" | |
| - type: section | |
| fields: | |
| - type: mrkdwn | |
| text: "*Ref:*\n`${{ github.event.client_payload.ref || github.ref_name }}`" | |
| - type: mrkdwn | |
| text: "*Commit:*\n`${{ github.event.client_payload.commit_sha || github.sha }}`" | |
| - type: mrkdwn | |
| text: "*Event:*\n`${{ github.event_name }}`" | |
| - type: actions | |
| elements: | |
| - type: button | |
| text: | |
| type: plain_text | |
| text: View workflow run | |
| url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" |