-
Notifications
You must be signed in to change notification settings - Fork 33
75 lines (72 loc) · 2.52 KB
/
build-rust-src.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Xtensa Rust | rust-src
on:
workflow_dispatch:
inputs:
release_version:
description: "Xtensa Rust release version to build"
required: true
default: '1.83.0.1'
release_tag:
description: "Release tag where artifacts will be stored (e.g. v1.83.0.1, untagged-00000)"
required: true
default: "v1.83.0.1"
jobs:
get_release:
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/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 "url=$url" >> $GITHUB_OUTPUT
env:
response: ${{ steps.get_release.outputs.data }}
build-xtensa-rust:
name: Build Xtensa rust-src
needs: get_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
ASSET_PATH: "rust/build/dist/rust-src-nightly.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@v4
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
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 }}