Repository navigation
108 lines (93 loc) · 3.73 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (93 loc) · 3.73 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Tag used for release name, and as checkout target in official riscv-gnu-toolchain"
required: true
jobs:
create-release:
runs-on: [runs-on, runner=8cpu-linux-x64, spot=false, "run-id=${{ github.run_id }}"]
outputs:
tag_name: ${{ steps.release-info.outputs.tag_name }}
release_name: ${{ steps.release-info.outputs.release_name }}
steps:
- uses: actions/checkout@v6
- name: Release info
id: release-info
run: |
echo "tag_name=${{ inputs.tag }}" >> $GITHUB_OUTPUT
echo "release_name=${{ inputs.tag }}" >> $GITHUB_OUTPUT
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create ${{ steps.release-info.outputs.release_name }} --target "${{ github.ref_name }}" --generate-notes --latest=false
gcc-toolchain-release:
name: ${{ matrix.target }} (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 240
needs: create-release
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
target: riscv64im-linux-amd64
platform: linux
arch: amd64
- runner: ubuntu-24.04-arm
target: riscv64im-linux-arm64
platform: linux
arch: arm64
- runner: macos-15-intel
target: riscv64im-macos-amd64
platform: darwin
arch: amd64
- runner: macos-latest-xlarge
target: riscv64im-macos-arm64
platform: darwin
arch: arm64
steps:
- uses: actions/checkout@v6
- name: Build directory info
id: build-directory-info
run: echo "prefix=$PWD/dist" >> $GITHUB_OUTPUT
- name: Darwin setup
if: matrix.platform == 'darwin'
run: brew install make python3 gawk gnu-sed gmp mpfr libmpc isl zlib expat texinfo flock
- name: Linux setup
if: matrix.platform == 'linux'
run: |
sudo apt-get update -y
sudo apt-get install autoconf automake autotools-dev curl python3 python3-pip python3-tomli libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-dev libslirp-dev libncurses-dev
- name: Clone riscv-gnu-toolchain repo
run: git clone https://github.com/riscv/riscv-gnu-toolchain.git
- name: Checkout tag
working-directory: ./riscv-gnu-toolchain
run: git checkout ${{ inputs.tag }}
- name: Configure
working-directory: ./riscv-gnu-toolchain
run: ./configure --prefix="${{ steps.build-directory-info.outputs.prefix }}" --with-cmodel=medany --disable-gdb --with-arch=rv64im --with-abi=lp64
- name: Build (Linux)
if: matrix.platform == 'linux'
working-directory: ./riscv-gnu-toolchain
run: make
- name: Build (macOS)
if: matrix.platform == 'darwin'
working-directory: ./riscv-gnu-toolchain
run: gmake
- name: Create toolchain archive
run: tar -czvf "${{ matrix.target }}.tar.gz" -C "${{ steps.build-directory-info.outputs.prefix }}" .
- name: Upload toolchain
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ needs.create-release.outputs.release_name }} "${{ matrix.target }}.tar.gz"
set-latest-release:
runs-on: ubuntu-latest
needs: [create-release, gcc-toolchain-release]
steps:
- uses: actions/checkout@v6
- name: Set latest release
env:
GH_TOKEN: ${{ github.token }}
run: gh release edit ${{ needs.create-release.outputs.release_name }} --latest=true