-
Notifications
You must be signed in to change notification settings - Fork 34
187 lines (183 loc) · 6.1 KB
/
main.yml
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: CI
on: [pull_request, push, workflow_dispatch]
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Shell Check
run: ./shellcheck.sh
shell: bash
build:
name: Build
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
arch: x86_64
os: ubuntu-22.04
ninja_file: ninja-linux.zip
ninja_dir: /usr/local/bin
ninja_sudo: sudo
rust: stable
tar: linux
out_dir: out
- target: aarch64-unknown-linux-gnu
arch: aarch64
os: ubuntu-22.04-arm
ninja_file: ninja-linux-aarch64.zip
ninja_dir: /usr/local/bin
ninja_sudo: sudo
rust: stable
tar: linux
out_dir: out
- target: aarch64-apple-darwin
arch: aarch64
os: macos-latest
ninja_file: ninja-mac.zip
ninja_dir: /usr/local/bin
ninja_sudo: sudo
rust: stable
tar: osx
out_dir: out
- target: x86_64-apple-darwin
arch: x86_64
os: macos-13
ninja_file: ninja-mac.zip
ninja_dir: /usr/local/bin
ninja_sudo: sudo
rust: stable
tar: osx
out_dir: out
- target: x86_64-pc-windows-msvc
arch: x86_64
os: windows-latest
ninja_file: ninja-win.zip
ninja_dir: /usr/bin
ninja_sudo:
rust: stable
tar: windows
out_dir: /c/out
steps:
- uses: actions/checkout@v1
- name: Install coreutils and swig
run: |
brew update && brew install coreutils swig ninja
if: matrix.tar == 'osx'
shell: bash
- name: Install Linux tools for LLDB
run: |
sudo apt-get install build-essential swig python3-dev libedit-dev libncurses5-dev libxml2-dev
if: matrix.os == 'ubuntu-22.04'
- name: Install Ninja
run: |
curl -L -O "https://github.com/ninja-build/ninja/releases/download/v1.12.1/${{ matrix.ninja_file }}" && \
${{ matrix.ninja_sudo }} unzip ${{ matrix.ninja_file }} -d ${{ matrix.ninja_dir }} && rm ${{ matrix.ninja_file }}
if: matrix.tar != 'osx'
shell: bash
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.79.0
- name: Build
run: ./build.sh ${{ matrix.out_dir }}
shell: bash
- name: Upload ${{ matrix.tar }} tarball
uses: actions/upload-artifact@v4
with:
name: platform-tools-${{ matrix.tar }}-${{ matrix.arch }}.tar.bz2
path: platform-tools-${{ matrix.tar }}-${{ matrix.arch }}.tar.bz2
- name: Upload move-dev ${{ matrix.tar }} tarball
uses: actions/upload-artifact@v4
with:
name: move-dev-${{ matrix.tar }}-${{ matrix.arch }}.tar.bz2
path: move-dev-${{ matrix.tar }}-${{ matrix.arch }}.tar.bz2
release:
name: Upload Release Assets
needs: build
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download Linux x86 tarball
uses: actions/download-artifact@v4
with:
name: platform-tools-linux-x86_64.tar.bz2
- name: Download Linux ARM tarball
uses: actions/download-artifact@v4
with:
name: platform-tools-linux-aarch64.tar.bz2
- name: Download macOS ARM tarball
uses: actions/download-artifact@v4
with:
name: platform-tools-osx-aarch64.tar.bz2
- name: Download macOS x86 tarball
uses: actions/download-artifact@v4
with:
name: platform-tools-osx-x86_64.tar.bz2
- name: Download Windows tarball
uses: actions/download-artifact@v4
with:
name: platform-tools-windows-x86_64.tar.bz2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Release Linux x86 tarball
id: upload-release-linux-x86_64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: platform-tools-linux-x86_64.tar.bz2
asset_name: platform-tools-linux-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release Linux ARM tarball
id: upload-release-linux-aarch64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: platform-tools-linux-aarch64.tar.bz2
asset_name: platform-tools-linux-aarch64.tar.bz2
asset_content_type: application/zip
- name: Release macOS ARM tarball
id: upload-release-macos-aarch64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: platform-tools-osx-aarch64.tar.bz2
asset_name: platform-tools-osx-aarch64.tar.bz2
asset_content_type: application/zip
- name: Release macOS x86 tarball
id: upload-release-macos-x86_64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: platform-tools-osx-x86_64.tar.bz2
asset_name: platform-tools-osx-x86_64.tar.bz2
asset_content_type: application/zip
- name: Release Windows tarball
id: upload-release-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: platform-tools-windows-x86_64.tar.bz2
asset_name: platform-tools-windows-x86_64.tar.bz2
asset_content_type: application/zip