[0.7.x] Fix riscv64 runtime breakage #169
Workflow file for this run
This file contains 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: Dist build | |
on: | |
push: | |
paths: | |
- pyproject.toml | |
- poetry.lock | |
- '**.py' | |
- 'scripts/**' | |
tags: | |
- '*' | |
pull_request: | |
paths: | |
- pyproject.toml | |
- poetry.lock | |
- '**.py' | |
- 'scripts/**' | |
jobs: | |
dist: | |
strategy: | |
matrix: | |
# https://stackoverflow.com/questions/66025220/paired-values-in-github-actions-matrix | |
include: | |
- { arch: amd64, runs_on: ubuntu-latest } | |
- { arch: arm64, runs_on: [self-hosted, linux, arm64] } | |
- { arch: riscv64, runs_on: [self-hosted, linux, riscv64] } | |
name: Linux ${{ matrix.arch }} | |
runs-on: ${{ matrix.runs_on }} | |
outputs: | |
run_id: ${{ github.run_id }} | |
release_mirror_url: ${{ steps.run_dist.outputs.release_mirror_url }} | |
container: | |
image: ghcr.io/ruyisdk/ruyi-python-dist:20240325 | |
options: --user root # https://github.com/actions/checkout/issues/1014 | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
volumes: | |
- ${{ github.workspace }}:/home/b/ruyi | |
- tmp-build:/build | |
- tmp-poetry-cache:/poetry-cache | |
- tmp-ccache:/ccache | |
- tmp-ruyi-dist-cache:/ruyi-dist-cache | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache deps and Nuitka output | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-tgt-${{ matrix.arch }}-r3 | |
path: | | |
/ccache | |
/poetry-cache | |
/ruyi-dist-cache | |
- name: Run dist | |
id: run_dist | |
run: RUYI_DIST_INNER=x /home/b/ruyi/scripts/dist.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ruyi.${{ matrix.arch }} | |
path: /build/ruyi | |
compression-level: 0 # the Nuitka onefile payload is already compressed | |
dist-windows: | |
strategy: | |
matrix: | |
include: | |
- { arch: amd64, runs_on: windows-latest } | |
name: Windows ${{ matrix.arch }} | |
runs-on: ${{ matrix.runs_on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
# Nuitka doesn't officially support Python 3.12 yet (see Nuitka doc), | |
# but '>=3.11' resolves to 3.12. | |
# python-version-file: pyproject.toml | |
python-version: '3.11' | |
cache: poetry | |
- name: Cache/restore Nuitka clcache contents | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-tgt-${{ matrix.arch }} | |
path: | | |
/clcache | |
- name: Install deps | |
run: poetry install && mkdir /build | |
- name: Run dist | |
run: "scripts\\dist.ps1" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ruyi.windows-${{ matrix.arch }}.exe | |
path: /build/ruyi.exe | |
compression-level: 0 # the Nuitka onefile payload is already compressed | |
release: | |
name: Make a GitHub Release | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
needs: | |
- dist | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: 'pyproject.toml' | |
- name: Download artifacts for release | |
uses: actions/download-artifact@v4 | |
with: | |
run-id: ${{ needs.dist.outputs.run_id }} | |
path: tmp/release | |
- name: Organize release artifacts | |
run: scripts/organize-release-artifacts.py tmp/release | |
- name: Render the release notes header | |
run: sed "s!@RELEASE_MIRROR_URL@!${{ needs.dist.outputs.release_mirror_url }}!g" < resources/release-notes-header-template.md > tmp/release-notes-header.md | |
- name: Make the release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: tmp/release-notes-header.md | |
files: tmp/release/ruyi-* | |
generate_release_notes: true | |
prerelease: ${{ contains(needs.dist.outputs.release_mirror_url, 'testing') }} |