build-rust-src-dispatch #37
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: build-rust-src-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: "build/1.73.0.1" | |
release_version: | |
description: "Release Version for generation" | |
required: true | |
default: '1.73.0.1' | |
rust_version: | |
description: "Version of esp rust to use" | |
required: true | |
default: "nightly" | |
release_tag: | |
description: "Tag used for uploading (e.g. v1.73.0.1, untagged-00000)" | |
required: true | |
default: "untagged-06704172812884cde852" | |
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/${{ github.event.inputs.release_tag }} | |
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: create_release | |
needs: get_release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
include: | |
- os: ubuntu-latest | |
ASSET_PATH: "rust/build/dist/rust-src-${{ github.event.inputs.rust_version }}.tar.xz" | |
ASSET_NAME: "rust-src-${{ github.event.inputs.release_version }}.tar.xz" | |
ASSET_CONTENT_TYPE: "application/x-tar" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
repository: esp-rs/rust | |
ref: esp-${{ github.event.inputs.release_version }} | |
submodules: true | |
path: "rust" | |
- name: Setup Ninja | |
uses: seanmiddleditch/gha-setup-ninja@master | |
- name: Configure Rust project | |
working-directory: rust | |
run: | | |
python3 src/bootstrap/configure.py --experimental-targets=Xtensa --release-channel=nightly --release-description="${{ github.event.inputs.release_version }}" --enable-extended --dist-compression-formats='xz' | |
- name: Build Rust src dist | |
working-directory: rust | |
run: | | |
python3 x.py dist rust-src | |
- 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 }} |