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 0
161 lines (130 loc) · 4.77 KB
/
release.yml
File metadata and controls
161 lines (130 loc) · 4.77 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
name: release
on:
push:
tags:
- 'v*'
defaults:
run:
shell: bash
jobs:
build-repos-zip:
name: upload repos.zip
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: make repos.zip
uses: ./.github/actions/make-repos-zip
- name: upload repos.zip
uses: actions/upload-artifact@v2
with:
name: repos.zip
path: repos.zip
build-rust-parser:
name: target = ${{ matrix.build.target }}
needs: ['build-repos-zip']
runs-on: ${{ matrix.build.os }}
env:
OUTPUT: rust-parser-${{ matrix.build.target }}${{ matrix.build.exe }}
FILELIST_PATH: filelist
strategy:
fail-fast: false
matrix:
build:
- { os: ubuntu-latest, features: jemallocator, target: x86_64-unknown-linux-gnu }
- { os: macos-latest, features: jemallocator, target: x86_64-apple-darwin }
- { os: windows-latest, exe: .exe, target: x86_64-pc-windows-msvc }
- { os: windows-latest, exe: .exe, target: x86_64-pc-windows-gnu }
steps:
- name: checkout
uses: actions/checkout@v3
- name: download repos
uses: actions/download-artifact@v2
with:
name: repos.zip
- name: unzip repos
run: unzip repos.zip
- name: build rust-parser
uses: ./.github/actions/make-rust-parser
with:
target: ${{ matrix.build.target }}
cargoflags: --features=${{ matrix.build.features }} --release
build_env: release
- name: give rust-parser representative name
run: cp rust-parser${{ matrix.build.exe }} ${{ env.OUTPUT }}
- name: install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.1"
- name: test rust-parser
run: |
echo "Rust: $(./rust-parser)" >> ${{ matrix.build.target }}.benchmark
echo "Ruby: $(ruby ruby-parser.rb)" >> ${{ matrix.build.target }}.benchmark
cat ${{ matrix.build.target }}.benchmark
- name: upload ${{ env.OUTPUT }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.OUTPUT }}
path: ${{ env.OUTPUT }}
- name: upload ${{ matrix.build.target }}.benchmark
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.build.target }}.benchmark
path: ${{ matrix.build.target }}.benchmark
make-release:
name: release
needs:
- 'build-repos-zip'
- 'build-rust-parser'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
# Parsers
- uses: actions/download-artifact@v2
with: { name: rust-parser-x86_64-unknown-linux-gnu }
- uses: actions/download-artifact@v2
with: { name: rust-parser-x86_64-apple-darwin }
- uses: actions/download-artifact@v2
with: { name: rust-parser-x86_64-pc-windows-msvc.exe }
- uses: actions/download-artifact@v2
with: { name: rust-parser-x86_64-pc-windows-gnu.exe }
- uses: actions/download-artifact@v2
with:
name: repos.zip
# Benchmarks
- uses: actions/download-artifact@v2
with: { name: x86_64-unknown-linux-gnu.benchmark }
- uses: actions/download-artifact@v2
with: { name: x86_64-apple-darwin.benchmark }
- uses: actions/download-artifact@v2
with: { name: x86_64-pc-windows-msvc.benchmark }
- uses: actions/download-artifact@v2
with: { name: x86_64-pc-windows-gnu.benchmark }
- name: merge benchmarks
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 >> 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 >> 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 >> release_notes.md
echo "" >> release_notes.md
echo "### Results for x86_64-pc-windows-gnu:" >> release_notes.md
echo "" >> release_notes.md
cat x86_64-pc-windows-gnu.benchmark >> release_notes.md
cat release_notes.md
- name: release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "rust-parser-*,repos.zip,ruby-parser.rb"
bodyFile: release_notes.md
token: ${{ secrets.GITHUB_TOKEN }}