Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit d7e1997

Browse files
authored
Merge pull request #9 from lib-ruby-parser/update-release-workflow
2 parents 1973e4e + f46b11a commit d7e1997

File tree

1 file changed

+28
-76
lines changed

1 file changed

+28
-76
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: release
2+
23
on:
34
push:
45
tags:
@@ -25,26 +26,38 @@ jobs:
2526
target: x86_64-unknown-linux-gnu
2627
cc: clang-12
2728
ar: llvm-ar-12
29+
zig: false
2830
lib_file: libruby_parser_c.a
2931
output_artifact_name: libruby_parser_c-x86_64-unknown-linux-gnu.a
3032

3133
- os: macos-latest
3234
target: x86_64-apple-darwin
3335
cc: clang
3436
ar: ar
37+
zig: false
3538
lib_file: libruby_parser_c.a
3639
output_artifact_name: libruby_parser_c-x86_64-apple-darwin.a
3740

41+
- os: macos-latest
42+
target: aarch64-apple-darwin
43+
cc: zig cc
44+
ar: ar
45+
zig: true
46+
lib_file: libruby_parser_c.a
47+
output_artifact_name: libruby_parser_c-aarch64-apple-darwin.a
48+
3849
- os: windows-latest
3950
target: x86_64-pc-windows-msvc
4051
cc: cl.exe
52+
zig: false
4153
lib_file: libruby_parser_c.lib
4254
output_artifact_name: libruby_parser_c-x86_64-pc-windows-msvc.lib
4355

4456
- os: windows-latest
4557
target: x86_64-pc-windows-gnu
4658
cc: gcc
4759
ar: ar
60+
zig: false
4861
lib_file: libruby_parser_c.a
4962
output_artifact_name: libruby_parser_c-x86_64-pc-windows-gnu.a
5063
steps:
@@ -71,6 +84,18 @@ jobs:
7184
- name: checkout
7285
uses: actions/checkout@v2
7386

87+
- name: fix link.exe on windows
88+
if: runner.os == 'Windows'
89+
run: rm "C:\\Program Files\\Git\\usr\\bin\\link.exe"
90+
91+
- name: install zig
92+
uses: goto-bus-stop/setup-zig@v2
93+
if: ${{ matrix.build.zig }}
94+
95+
- name: install cargo-zigbuild
96+
run: cargo install cargo-zigbuild
97+
if: ${{ matrix.build.zig }}
98+
7499
- name: codegen
75100
run: make do-codegen
76101

@@ -85,28 +110,6 @@ jobs:
85110
name: ${{ matrix.build.output_artifact_name }}
86111
path: ${{ matrix.build.output_artifact_name }}
87112

88-
- name: download benchmark assets
89-
run: make benchmark/download
90-
91-
- name: build C runner
92-
run: make benchmark/c-parser
93-
94-
# NOTE: ruby/setup-ruby breaks paths for MSVC,
95-
# and so all files must be compiled before running Ruby
96-
- name: install ruby
97-
uses: ruby/setup-ruby@v1
98-
with:
99-
ruby-version: "3.1.1"
100-
101-
- name: benchmark
102-
run: make benchmark/record
103-
104-
- name: upload ${{ matrix.build.target }}.benchmark-out
105-
uses: actions/upload-artifact@v2
106-
with:
107-
name: ${{ matrix.build.target }}.benchmark-out
108-
path: ${{ matrix.build.target }}.benchmark-out
109-
110113
build-header:
111114
name: build header file
112115
runs-on: ubuntu-latest
@@ -132,60 +135,11 @@ jobs:
132135
name: lib-ruby-parser.h
133136
path: lib-ruby-parser.h
134137

135-
build-release-notes:
136-
name: build release notes
137-
needs:
138-
- 'build-lib'
139-
runs-on: ubuntu-latest
140-
steps:
141-
- name: checkout
142-
uses: actions/checkout@v2
143-
144-
# download benchmark results
145-
- uses: actions/download-artifact@v2
146-
with: { name: x86_64-unknown-linux-gnu.benchmark-out }
147-
148-
- uses: actions/download-artifact@v2
149-
with: { name: x86_64-apple-darwin.benchmark-out }
150-
151-
- uses: actions/download-artifact@v2
152-
with: { name: x86_64-pc-windows-msvc.benchmark-out }
153-
154-
- uses: actions/download-artifact@v2
155-
with: { name: x86_64-pc-windows-gnu.benchmark-out }
156-
157-
- name: build release notes
158-
run: |
159-
ls -l
160-
echo "### Results for x86_64-unknown-linux-gnu:" >> release_notes.md
161-
echo "" >> release_notes.md
162-
cat x86_64-unknown-linux-gnu.benchmark-out >> release_notes.md
163-
echo "" >> release_notes.md
164-
echo "### Results for x86_64-apple-darwin:" >> release_notes.md
165-
echo "" >> release_notes.md
166-
cat x86_64-apple-darwin.benchmark-out >> release_notes.md
167-
echo "" >> release_notes.md
168-
echo "### Results for x86_64-pc-windows-msvc:" >> release_notes.md
169-
echo "" >> release_notes.md
170-
cat x86_64-pc-windows-msvc.benchmark-out >> release_notes.md
171-
echo "" >> release_notes.md
172-
echo "### Results for x86_64-pc-windows-gnu:" >> release_notes.md
173-
echo "" >> release_notes.md
174-
cat x86_64-pc-windows-gnu.benchmark-out >> release_notes.md
175-
cat release_notes.md
176-
177-
- name: upload release_notes.md
178-
uses: actions/upload-artifact@v2
179-
with:
180-
name: release_notes.md
181-
path: release_notes.md
182-
183138
make-release:
184139
name: release
185140
needs:
186141
- 'build-lib'
187142
- 'build-header'
188-
- 'build-release-notes'
189143
runs-on: ubuntu-latest
190144
steps:
191145
- name: checkout
@@ -198,6 +152,9 @@ jobs:
198152
- uses: actions/download-artifact@v2
199153
with: { name: libruby_parser_c-x86_64-apple-darwin.a }
200154

155+
- uses: actions/download-artifact@v2
156+
with: { name: libruby_parser_c-aarch64-apple-darwin.a }
157+
201158
- uses: actions/download-artifact@v2
202159
with: { name: libruby_parser_c-x86_64-pc-windows-msvc.lib }
203160

@@ -208,10 +165,6 @@ jobs:
208165
- uses: actions/download-artifact@v2
209166
with: { name: lib-ruby-parser.h }
210167

211-
# release notes
212-
- uses: actions/download-artifact@v2
213-
with: { name: release_notes.md }
214-
215168
- name: show artifacts
216169
run: ls -l
217170

@@ -221,5 +174,4 @@ jobs:
221174
allowUpdates: true
222175
artifactErrorsFailBuild: true
223176
artifacts: "libruby_parser_c-*,lib-ruby-parser.h"
224-
bodyFile: release_notes.md
225177
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)