Skip to content

Commit ee6372b

Browse files
[CPP-60]Create release.
1 parent efa38ee commit ee6372b

File tree

1 file changed

+176
-134
lines changed

1 file changed

+176
-134
lines changed

.github/workflows/main.yml

Lines changed: 176 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -5,153 +5,153 @@ on:
55
branches:
66
- 'main'
77
tags:
8-
- 'v*'
8+
- '[0-9]+.[0-9]+.[0-9]+*'
99
pull_request:
1010

1111
jobs:
1212

13-
# backend_bench:
14-
15-
# name: Backend Benchmarks
16-
17-
# strategy:
18-
# matrix:
19-
# os:
20-
# - ubuntu-20.04
21-
# - macos-10.15
22-
# - windows-2019
23-
24-
# runs-on: ${{ matrix.os }}
25-
26-
# steps:
27-
28-
# - name: Checkout source
29-
# uses: actions/checkout@v2
30-
# with:
31-
# submodules: recursive
32-
# ssh-key: ${{ secrets.SSH_KEY }}
33-
# ssh-strict: false
34-
35-
# - uses: webfactory/[email protected]
36-
# with:
37-
# ssh-private-key: ${{ secrets.SSH_KEY }}
38-
39-
# - name: Run ssh-keyscan
40-
# run: ssh-keyscan github.com >> ~/.ssh/known_hosts
41-
42-
# - name: Setup SSH for Windows Git LFS
43-
# run: |
44-
# & "C:\\Program Files\\Git\\bin\\sh.exe" -c "ssh-keyscan github.com >> ~/.ssh/known_hosts"
45-
# & "C:\\Program Files\\Git\\bin\\sh.exe" -c "echo '${{ secrets.SSH_KEY }}' >> ~/.ssh/id_rsa"
46-
# if: matrix.os == 'windows-2019'
47-
48-
# - name: Install ${{ runner.os }} Dependencies.
49-
# shell: bash
50-
# run: |
51-
# if [ "$RUNNER_OS" == "Linux" ]; then
52-
# sudo apt-get install -y capnproto git-lfs
53-
# elif [ "$RUNNER_OS" == "macOS" ]; then
54-
# brew install capnp git-lfs
55-
# elif [ "$RUNNER_OS" == "Windows" ]; then
56-
# choco install -y capnproto git-lfs
57-
# fi
58-
59-
# - name: Pull Git LFS objects
60-
# run: git lfs pull
61-
# env:
62-
# GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
63-
64-
# - name: Install stable Rust
65-
# uses: actions-rs/toolchain@v1
66-
# with:
67-
# toolchain: stable
68-
# override: true
69-
70-
# - uses: davidB/rust-cargo-make@v1
71-
# with:
72-
# version: '0.32.11'
73-
74-
# - uses: conda-incubator/setup-miniconda@v2
75-
# with:
76-
# activate-environment: console_pp
77-
# environment-file: conda.yml
78-
79-
# - name: Poetry Install
80-
# run: |
81-
# conda run -n console_pp poetry install
82-
83-
# - name: Run Benchmarks
84-
# shell: bash
85-
# run: |
86-
# cargo make benches
87-
88-
# checks:
89-
90-
# name: Code Quality Checks
91-
92-
# runs-on: ubuntu-latest
93-
94-
# steps:
95-
96-
# - name: Checkout source
97-
# uses: actions/checkout@v2
98-
# with:
99-
# submodules: recursive
100-
# ssh-key: ${{ secrets.SSH_KEY }}
101-
102-
# - name: Install stable Rust
103-
# uses: actions-rs/toolchain@v1
104-
# with:
105-
# toolchain: stable
106-
# override: true
107-
# components: rustfmt, clippy
108-
109-
# - uses: davidB/rust-cargo-make@v1
110-
# with:
111-
# version: '0.32.11'
112-
113-
# - uses: conda-incubator/setup-miniconda@v2
114-
# with:
115-
# activate-environment: console_pp
116-
# environment-file: conda.yml
117-
118-
# - name: Install Dependencies.
119-
# run: |
120-
# sudo apt-get install -y capnproto
121-
122-
# - name: Poetry Install
123-
# run: |
124-
# conda run -n console_pp poetry install
125-
126-
# - name: Run Format Check
127-
# run: |
128-
# cargo make format-check
129-
130-
# - name: Run Type Check
131-
# run: |
132-
# cargo make types
133-
134-
# - name: Run Lint Check
135-
# run: |
136-
# cargo make lint
137-
138-
# - name: Run Tests
139-
# run: |
140-
# cargo make tests
13+
backend_bench:
14+
15+
name: Backend Benchmarks
16+
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu-20.04
21+
- macos-10.15
22+
- windows-2019
23+
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
28+
- name: Checkout source
29+
uses: actions/checkout@v2
30+
with:
31+
submodules: recursive
32+
ssh-key: ${{ secrets.SSH_KEY }}
33+
ssh-strict: false
34+
35+
- uses: webfactory/[email protected]
36+
with:
37+
ssh-private-key: ${{ secrets.SSH_KEY }}
38+
39+
- name: Run ssh-keyscan
40+
run: ssh-keyscan github.com >> ~/.ssh/known_hosts
41+
42+
- name: Setup SSH for Windows Git LFS
43+
run: |
44+
& "C:\\Program Files\\Git\\bin\\sh.exe" -c "ssh-keyscan github.com >> ~/.ssh/known_hosts"
45+
& "C:\\Program Files\\Git\\bin\\sh.exe" -c "echo '${{ secrets.SSH_KEY }}' >> ~/.ssh/id_rsa"
46+
if: matrix.os == 'windows-2019'
47+
48+
- name: Install ${{ runner.os }} Dependencies.
49+
shell: bash
50+
run: |
51+
if [ "$RUNNER_OS" == "Linux" ]; then
52+
sudo apt-get install -y capnproto git-lfs
53+
elif [ "$RUNNER_OS" == "macOS" ]; then
54+
brew install capnp git-lfs
55+
elif [ "$RUNNER_OS" == "Windows" ]; then
56+
choco install -y capnproto git-lfs
57+
fi
58+
59+
- name: Pull Git LFS objects
60+
run: git lfs pull
61+
env:
62+
GIT_SSH_COMMAND: ssh -o StrictHostKeyChecking=no
63+
64+
- name: Install stable Rust
65+
uses: actions-rs/toolchain@v1
66+
with:
67+
toolchain: stable
68+
override: true
69+
70+
- uses: davidB/rust-cargo-make@v1
71+
with:
72+
version: '0.32.11'
73+
74+
- uses: conda-incubator/setup-miniconda@v2
75+
with:
76+
activate-environment: console_pp
77+
environment-file: conda.yml
78+
79+
- name: Poetry Install
80+
run: |
81+
conda run -n console_pp poetry install
82+
83+
- name: Run Benchmarks
84+
shell: bash
85+
run: |
86+
cargo make benches
87+
88+
checks:
89+
90+
name: Code Quality Checks
91+
92+
runs-on: ubuntu-latest
93+
94+
steps:
95+
96+
- name: Checkout source
97+
uses: actions/checkout@v2
98+
with:
99+
submodules: recursive
100+
ssh-key: ${{ secrets.SSH_KEY }}
101+
102+
- name: Install stable Rust
103+
uses: actions-rs/toolchain@v1
104+
with:
105+
toolchain: stable
106+
override: true
107+
components: rustfmt, clippy
108+
109+
- uses: davidB/rust-cargo-make@v1
110+
with:
111+
version: '0.32.11'
112+
113+
- uses: conda-incubator/setup-miniconda@v2
114+
with:
115+
activate-environment: console_pp
116+
environment-file: conda.yml
117+
118+
- name: Install Dependencies.
119+
run: |
120+
sudo apt-get install -y capnproto
121+
122+
- name: Poetry Install
123+
run: |
124+
conda run -n console_pp poetry install
125+
126+
- name: Run Format Check
127+
run: |
128+
cargo make format-check
129+
130+
- name: Run Type Check
131+
run: |
132+
cargo make types
133+
134+
- name: Run Lint Check
135+
run: |
136+
cargo make lint
137+
138+
- name: Run Tests
139+
run: |
140+
cargo make tests
141141
142142
build:
143143

144144
name: Build Binaries
145145

146-
# needs:
147-
# - checks
148-
# - backend_bench
146+
needs:
147+
- checks
148+
- backend_bench
149149

150150
strategy:
151151
matrix:
152152
os:
153-
# - ubuntu-20.04
154-
# - macos-10.15
153+
- ubuntu-20.04
154+
- macos-10.15
155155
- windows-2019
156156

157157
runs-on: ${{ matrix.os }}
@@ -281,3 +281,45 @@ jobs:
281281
else
282282
python benches/frontend_bench.py --binary=swift_navigation_console
283283
fi
284+
285+
release:
286+
name: Create Release
287+
needs:
288+
- frontend_bench
289+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
290+
runs-on: ubuntu-20.04
291+
steps:
292+
- name: Pull Windows Artifacts
293+
uses: actions/download-artifact@v2
294+
with:
295+
name: Windows-artifacts
296+
path: |
297+
windows
298+
- name: Pull Linux Artifacts
299+
uses: actions/download-artifact@v2
300+
with:
301+
name: Linux-artifacts
302+
path: |
303+
linux
304+
- name: Pull macOS Artifacts
305+
uses: actions/download-artifact@v2
306+
with:
307+
name: macOS-artifacts
308+
path: |
309+
macos
310+
- name: Store Env Vars
311+
shell: bash
312+
run: |
313+
echo "WINDOWS_ARCHIVE=$(cat windows/release-archive.filename)" >>$GITHUB_ENV
314+
echo "LINUX_ARCHIVE=$(cat linux/release-archive.filename)" >>$GITHUB_ENV
315+
echo "MACOS_ARCHIVE=$(cat macos/release-archive.filename)" >>$GITHUB_ENV
316+
- name: Release
317+
uses: softprops/action-gh-release@v1
318+
with:
319+
files: |
320+
windows/${{ env.WINDOWS_ARCHIVE }}
321+
linux/${{ env.LINUX_ARCHIVE }}
322+
macos/${{ env.MACOS_ARCHIVE }}
323+
env:
324+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
325+

0 commit comments

Comments
 (0)