Xtensa Rust | x86_64-pc-windows-gnu #3
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: Xtensa Rust | x86_64-pc-windows-gnu | |
on: | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: "Xtensa Rust release version to build" | |
required: true | |
default: '1.73.0.1' | |
release_tag: | |
description: "Release tag where artifacts will be stored (e.g. v1.73.0.1, untagged-00000)" | |
required: true | |
default: "untagged-3ecdd54e672f465cad2e" | |
jobs: | |
get_release: | |
name: Get release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.get_upload_url.outputs.url }} | |
steps: | |
- uses: octokit/request-action@v2.x | |
id: get_release | |
with: | |
route: GET /repos/esp-rs/rust-build/releases/tags/${{ github.event.inputs.release_tag }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: get upload url | |
id: get_upload_url | |
run: | | |
url=$(echo "$response" | jq -r '.upload_url') | |
echo "::set-output name=url::$url" | |
env: | |
response: ${{ steps.get_release.outputs.data }} | |
build-xtensa-rust: | |
name: Build Xtensa Rust for ${{ matrix.os }} | |
needs: get_release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [x86_64-pc-windows-gnu-self-hosted] | |
include: | |
- os: x86_64-pc-windows-gnu-self-hosted | |
ASSET_PATH: "rust/build/dist/rust-nightly-x86_64-pc-windows-gnu.zip" | |
ASSET_NAME: "rust-nightly-x86_64-pc-windows-gnu.zip" | |
ASSET_CONTENT_TYPE: "application/x-tar" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Checkout repository - esp-rs/rust | |
uses: actions/checkout@v4 | |
with: | |
path: rust | |
repository: esp-rs/rust | |
ref: esp-${{ github.event.inputs.release_version }} | |
submodules: true | |
- name: Unmount local drive | |
id: unount_path_before | |
continue-on-error: true | |
run: subst "R:" /D | |
- name: Map local long path to new drive | |
id: map_path | |
shell: powershell | |
run: subst "R:" "$env:GITHUB_WORKSPACE\rust" | |
- name: Prepare build | |
working-directory: "R:" | |
run: | | |
C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description='${{ github.event.inputs.release_version }}' --enable-extended --tools=clippy,cargo,rustfmt,rust-analyzer-proc-macro-srv --dist-compression-formats='xz' --enable-lld" | |
- name: Build with x.py - dist packages | |
id: build-rust | |
working-directory: "R:" | |
continue-on-error: true | |
run: C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 x.py dist --stage 2" | |
# This step make sense only on Azure runners with 8 cores and 16 GB RAM, | |
# because LLVM OOMs. Either increase memory or decrease number of parallel processes. | |
#- name: Retry build with x.py - dist packages - in case of failure on LLVM OOM | |
# id: retry-build-rust | |
# if: steps.build-rust.outcome == 'failure' | |
# working-directory: "R:" | |
# continue-on-error: true | |
# run: C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -lc "cd /r; python3 x.py dist --stage 2" | |
- name: Repackage binary | |
id: repackage-binary | |
continue-on-error: true | |
shell: powershell | |
working-directory: "R:/build/dist" | |
run: | | |
&"$env:GITHUB_WORKSPACE/support/rust-build/Repackage-RustRelease.ps1" -DefaultHost x86_64-pc-windows-gnu | |
- name: Upload Release Asset | |
if: steps.repackage-binary.outcome != 'failure' | |
id: upload-release-asset | |
continue-on-error: true | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.get_release.outputs.upload_url }} | |
asset_path: ${{ matrix.ASSET_PATH }} | |
asset_name: ${{ matrix.ASSET_NAME }} | |
asset_content_type: ${{ matrix.ASSET_CONTENT_TYPE }} | |
- name: Unmount local drive | |
id: unount_path | |
continue-on-error: true | |
run: subst "R:" /D | |
- name: Fail if build failed | |
if: steps.repackage-binary.outcome == 'failure' | |
run: exit 1 |