-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add build of windows gnu by self hosted runner
- Loading branch information
Showing
2 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
108 changes: 108 additions & 0 deletions
108
.github/workflows/build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: build-rust-x86_64-pc-windows-gnu-self-hosted-dispatch | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
upload_artifacts: | ||
description: "Upload final artifacts to Release?" | ||
required: true | ||
default: "yes" | ||
rust_build_branch: | ||
description: "Branch of rust-build to use" | ||
required: true | ||
default: "main" | ||
release_version: | ||
description: "Release Version for generation" | ||
required: true | ||
default: '1.65.0.0' | ||
rust_version: | ||
description: "Version of esp rust to use" | ||
required: true | ||
default: "nightly" | ||
rust_target: | ||
description: "Target triple" | ||
required: true | ||
default: "x86_64-pc-windows-gnu" | ||
|
||
jobs: | ||
get_release: | ||
# https://github.com/octokit/request-action | ||
name: Get release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.get_upload_url.outputs.url }} | ||
steps: | ||
- uses: octokit/[email protected] | ||
id: get_release | ||
with: | ||
route: GET /repos/{owner}/{repo}/releases/tags/v${{ github.event.inputs.release_version }} | ||
owner: esp-rs | ||
repo: rust-build | ||
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-idf-rust: | ||
name: Build IDF 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-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.zip" | ||
ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-${{ github.event.inputs.rust_target }}.zip" | ||
ASSET_CONTENT_TYPE: "application/x-tar" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Checkout repository - esp-rs/rust | ||
uses: actions/checkout@v2 | ||
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: pwsh | ||
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 --enable-extended --tools=clippy,cargo,rustfmt --dist-compression-formats='xz'" | ||
- name: Build with x.py - dist packages | ||
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 | ||
shell: pwsh | ||
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: github.event.inputs.upload_artifacts == 'yes' | ||
id: upload-release-asset | ||
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 |
7 changes: 4 additions & 3 deletions
7
support/rust-build/x86_64-pc-windows-gnu/Prepare-BuildEnvironment.ps1
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
#Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
#choco install msys2 -y | ||
|
||
choco install msys2 -y | ||
winget install --id MSYS2.MSYS2 | ||
|
||
msys2_shell.cmd -mingw64 | ||
c:\msys64\msys2_shell.cmd -mingw64 |