-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy paththrustc-x86_64-linux-ubuntu.yml
More file actions
159 lines (127 loc) · 4.74 KB
/
Copy paththrustc-x86_64-linux-ubuntu.yml
File metadata and controls
159 lines (127 loc) · 4.74 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Thrust Compiler (Linux - Ubuntu x86_64)
on:
push:
tags:
- 'thrustc-x86_64-linux-ubuntu-v*.*.*'
jobs:
thrustc-x86_64-linux-ubuntu:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Generating Unique ID
run: |
BASE_NAME=$(echo "$GITHUB_REF" | sed 's|^refs/tags/||')
VERSION=$(echo "$BASE_NAME" | sed 's|^thrustc-x86_64-linux-ubuntu-||')
BUILD_ID="${BASE_NAME}-${GITHUB_RUN_ID}"
echo "BUILD_ID=$BUILD_ID" >> $GITHUB_ENV
echo "TAG_NAME=$BASE_NAME" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Unique ID: $BUILD_ID"
echo "Version: $VERSION"
- name: Cloning Thrust Compiler
run: |
git clone --depth 1 https://github.com/thrustlang/thrustc
- name: Reading Changelog
run: |
CHANGELOG_PATH="thrustc/changelogs/${{ env.TAG_NAME }}/README.md"
if [ ! -f "$CHANGELOG_PATH" ]; then
echo "::error::No changelog found for tag '${{ env.TAG_NAME }}'. A changelog must exist at $CHANGELOG_PATH before releasing a compiler version."
exit 1
fi
CHANGELOG_CONTENT=$(cat "$CHANGELOG_PATH")
{
echo "CHANGELOG<<EOF"
echo "$CHANGELOG_CONTENT"
echo "EOF"
} >> $GITHUB_ENV
echo "Version changelog loaded successfully."
- name: Installing dependencies
run: |
sudo apt-get remove -y llvm-16* clang-16*
sudo rm -rf /usr/lib/llvm-16
sudo apt-get install -y \
libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
libx11-dev libxkbcommon-dev libxkbcommon-x11-dev \
libfontconfig1-dev libfreetype6-dev
sudo apt-get install -y upx-ucl build-essential python3 libz-dev binutils xz-utils libgccjit-12-dev clang
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
- name: Cloning the Compiler Dependency Builder
run: |
git clone --depth 1 https://github.com/thrustlang/compiler-dependency-builder
- name: Running the Compiler Dependency Builder
run: |
cargo run -- --llvm-major 17 \
--llvm-minor 0 \
--llvm-patch 6 \
--llvm-cpp-flags "-include cstdint"
working-directory: compiler-dependency-builder
- name: Installing and Configuring Build Cache
run: |
cargo install sccache
working-directory: thrustc
- name: Building Thrust Compiler (Release)
run: |
cargo build --release
mv target/release-stripped/thrustc target/release-stripped/thrustc-stripped
working-directory: thrustc
- name: Building Thrust Compiler (Release - Stripped)
run: |
cargo build --profile release-stripped
mv target/release-stripped/thrustc target/release-stripped/thrustc-stripped
working-directory: thrustc
- name: Extracting File Type and Dynamic Dependencies
run: |
BINARY="thrustc/target/release/thrustc"
LDD_OUTPUT=$(ldd "$BINARY" 2>/dev/null || echo "Could not inspect binary")
FILE_OUTPUT=$(file "$BINARY" 2>/dev/null || echo "Could not determine file type")
{
echo "DYNAMIC_DEPS<<EOF"
echo "$LDD_OUTPUT"
echo "EOF"
} >> $GITHUB_ENV
{
echo "FILE_TYPE<<EOF"
echo "$FILE_OUTPUT"
echo "EOF"
} >> $GITHUB_ENV
- name: Releasing Thrust Compiler
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
body: |
# Thrust Compiler
Version: ${{ env.VERSION }}
## Backends
### LLVM
Architecture targets for which the compiler was compiled.
- ``x86_64``
- ``AArch64``
- ``RISC-V``
- ``ARM``
- ``MIPS``
- ``PowerPC``
- ``SystemZ``
- ``AMDGPU``
- ``Hexagon``
- ``Lanai``
- ``LoongArch``
- ``MSP430``
- ``NVPTX``
- ``SPARC``
- ``XCore``
- ``BPF``
- ``SPIR-V``
- ``WebAssembly``
${{ env.CHANGELOG }}
## File Type
${{ env.FILE_TYPE }}
## Dynamic Dependencies
${{ env.DYNAMIC_DEPS }}
files: |
thrustc/target/release/thrustc
thrustc/target/release-stripped/thrustc-stripped
draft: false