-
Notifications
You must be signed in to change notification settings - Fork 33
88 lines (85 loc) · 3.03 KB
/
build-aarch64-unknown-linux-gnu.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
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Xtensa Rust | aarch64-unknown-linux-gnu
on:
workflow_dispatch:
inputs:
release_version:
description: "Xtensa Rust release version to build"
required: true
default: '1.82.0.2'
release_tag:
description: "Release tag where artifacts will be stored (e.g. v1.82.0.2, untagged-00000)"
required: true
default: "v1.82.0.2"
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
needs: get_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-m1-self-hosted]
include:
- os: macos-m1-self-hosted
ASSET_PATH: "build/dist/rust-nightly-aarch64-unknown-linux-gnu.tar.xz"
ASSET_NAME: "rust-${{ github.event.inputs.release_version }}-aarch64-unknown-linux-gnu.tar.xz"
ASSET_CONTENT_TYPE: "application/x-tar"
steps:
- name: Initialize docker
run: |
if ! launchctl list | grep -q com.docker.docker; then
echo "Starting Docker..."
open --background -a Docker
# Wait for Docker to start
while ! docker system info > /dev/null 2>&1; do
echo "Waiting for Docker to start..."
sleep 10
done
else
echo "Docker is already running."
fi
docker container rm rust-linux || echo "Container name rust-linux is available"
- name: Checkout repository
uses: actions/checkout@v4
- name: Build construction container
run: |
cd support/rust-build/aarch64-unknown-linux-gnu
docker build -t ubuntu-builder -f Containerfile .
- name: Build Rust
run: |
docker run -e RELEASE_DESCRIPTION='${{ github.event.inputs.release_version }}' --name rust-linux ubuntu-builder ./build.sh
mkdir -p build
docker cp rust-linux:/home/rust/rust/build/dist build/dist
- 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 }}
- name: Clean up
run: |
docker container rm rust-linux
#docker machine stop
rm -rf build