Upload installer to release assets #1
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: Upload installer to release assets | |
on: | |
workflow_dispatch: | |
inputs: | |
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.74.0.0" | |
rust_version: | |
description: "Version of esp rust to use" | |
required: true | |
default: "1.74.0" | |
# We Break this down into individual jobs to avoid disk space issues | |
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/request-action@v2.x | |
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 }} | |
upload-installers: | |
name: Upload installation scripts | |
runs-on: ubuntu-latest | |
needs: get_release | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.rust_build_branch }} | |
- name: Upload Bash installer | |
id: upload-bash-installer | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.get_release.outputs.upload_url }} | |
asset_path: install-rust-toolchain.sh | |
asset_name: install-rust-toolchain.sh | |
asset_content_type: text/plain |