This repository was archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
201 lines (168 loc) · 5.72 KB
/
release.yml
File metadata and controls
201 lines (168 loc) · 5.72 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
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: release
on:
push:
tags:
- 'v*'
jobs:
build-lib:
name: build lib file (target = ${{ matrix.build.target }})
runs-on: ${{ matrix.build.os }}
env:
BUILD_ENV: release
TARGET: ${{ matrix.build.target }}
CXX: ${{ matrix.build.cxx }}
AR: ${{ matrix.build.ar }}
strategy:
fail-fast: false
matrix:
build:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cxx: clang++-12
ar: llvm-ar-12
lib_file: libruby_parser_cpp.a
output_artifact_name: libruby_parser_cpp-x86_64-unknown-linux-gnu.a
- os: macos-latest
target: x86_64-apple-darwin
cxx: clang++
ar: ar
lib_file: libruby_parser_cpp.a
output_artifact_name: libruby_parser_cpp-x86_64-apple-darwin.a
- os: windows-latest
target: x86_64-pc-windows-msvc
cxx: cl.exe
lib_file: libruby_parser_cpp.lib
output_artifact_name: libruby_parser_cpp-x86_64-pc-windows-msvc.lib
steps:
- name: setup msvc on windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.build.target }}
override: true
- name: print rustc detailed version
run: rustc --version --verbose
- name: checkout
uses: actions/checkout@v2
- name: codegen
run: make do-codegen
- name: make lib file
run: |
make ${{ matrix.build.lib_file }}
cp ${{ matrix.build.lib_file }} ${{ matrix.build.output_artifact_name }}
- name: upload ${{ matrix.build.output_artifact_name }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.build.output_artifact_name }}
path: ${{ matrix.build.output_artifact_name }}
- name: download benchmark assets
run: make benchmark/download
- name: build C++ runner
run: make benchmark/cpp-parser
# NOTE: ruby/setup-ruby breaks paths for MSVC,
# and so all files must be compiled before running Ruby
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.1"
- name: benchmark
run: make benchmark/record
- name: upload ${{ matrix.build.target }}.benchmark-out
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.build.target }}.benchmark-out
path: ${{ matrix.build.target }}.benchmark-out
build-header:
name: build header file
runs-on: ubuntu-latest
env:
TARGET: x86_64-unknown-linux-gnu
steps:
- name: install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: checkout
uses: actions/checkout@v2
- name: build lib-ruby-parser.hpp
run: make lib-ruby-parser.hpp
- name: upload lib-ruby-parser.hpp
uses: actions/upload-artifact@v2
with:
name: lib-ruby-parser.hpp
path: lib-ruby-parser.hpp
build-release-notes:
name: build release notes
needs:
- 'build-lib'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
# download benchmark results
- uses: actions/download-artifact@v2
with: { name: x86_64-unknown-linux-gnu.benchmark-out }
- uses: actions/download-artifact@v2
with: { name: x86_64-apple-darwin.benchmark-out }
- uses: actions/download-artifact@v2
with: { name: x86_64-pc-windows-msvc.benchmark-out }
- name: build release notes
run: |
ls -l
echo "### Results for x86_64-unknown-linux-gnu:" >> release_notes.md
echo "" >> release_notes.md
cat x86_64-unknown-linux-gnu.benchmark-out >> release_notes.md
echo "" >> release_notes.md
echo "### Results for x86_64-apple-darwin:" >> release_notes.md
echo "" >> release_notes.md
cat x86_64-apple-darwin.benchmark-out >> release_notes.md
echo "" >> release_notes.md
echo "### Results for x86_64-pc-windows-msvc:" >> release_notes.md
echo "" >> release_notes.md
cat x86_64-pc-windows-msvc.benchmark-out >> release_notes.md
echo "" >> release_notes.md
cat release_notes.md
- name: upload release_notes.md
uses: actions/upload-artifact@v2
with:
name: release_notes.md
path: release_notes.md
make-release:
name: release
needs:
- 'build-lib'
- 'build-header'
- 'build-release-notes'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
# lib files
- uses: actions/download-artifact@v2
with: { name: libruby_parser_cpp-x86_64-unknown-linux-gnu.a }
- uses: actions/download-artifact@v2
with: { name: libruby_parser_cpp-x86_64-apple-darwin.a }
- uses: actions/download-artifact@v2
with: { name: libruby_parser_cpp-x86_64-pc-windows-msvc.lib }
# header file
- uses: actions/download-artifact@v2
with: { name: lib-ruby-parser.hpp }
# release notes
- uses: actions/download-artifact@v2
with: { name: release_notes.md }
- name: show artifacts
run: ls -l
- name: release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "libruby_parser_cpp-*,lib-ruby-parser.hpp"
bodyFile: release_notes.md
token: ${{ secrets.GITHUB_TOKEN }}