Skip to content

Commit a40ecbd

Browse files
committed
[ci] use matrix-based workflows
Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
1 parent eb0fee7 commit a40ecbd

2 files changed

Lines changed: 41 additions & 87 deletions

File tree

.github/workflows/build-commit.yml

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,39 @@
11
name: Build
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches:
5+
- 'sr229/octocat'
6+
- 'master'
37
jobs:
4-
build_amd64:
5-
name: Build (AMD64 - CentOS 7 Target)
6-
runs-on: ubuntu-latest
8+
build:
9+
strategy:
10+
matrix:
11+
platform: [ubuntu-latest, macos-latest]
12+
linux-platforms: ['linux', 'alpine']
13+
runs-on: ${{ matrix.platform }}
714
steps:
8-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@master
916

10-
- name: Build code-server Binary
11-
run: yarn && bash ./scripts/ci.bash
12-
env:
13-
VERSION: master
14-
TARGET: 'linux'
15-
VSCODE_VERSION: '1.38.1'
16-
MINIFY: 'true'
17-
PACKAGE: 'true'
18-
build_amd64_alpine:
19-
name: Build (AMD64 - Alpine Target)
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v1
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: '10.x'
2320

24-
- name: Build code-server Binary
25-
run: yarn && bash ./scripts/ci.bash
21+
- name: Build code-server binary (Linux)
22+
run: bash ./scripts/ci.bash
2623
env:
27-
VERSION: master
28-
TARGET: 'alpine'
24+
MAJOR_VERSION: '2'
25+
TARGET: ${{ matrix.linux-platforms }}
26+
VERSION: '${MAJOR_VERSION}.${GITHUB_SHA}'
2927
VSCODE_VERSION: '1.38.1'
3028
MINIFY: 'true'
3129
PACKAGE: 'true'
32-
build_macos:
33-
name: Build (macOS Target)
34-
runs-on: macOS-latest
35-
steps:
36-
- uses: actions/checkout@v1
37-
38-
- name: Workaround outdated Node in CI
39-
run: brew uninstall node@6 && brew install node@12
4030

41-
- name: Build code-server Binary
42-
run: yarn && bash ./scripts/ci.bash
31+
- name: Build code-server binary (macOS)
32+
if: contains(${{ matrix.platform }}, 'macos-latest')
33+
run: bash ./scripts/ci.bash
4334
env:
44-
VERSION: master
45-
TARGET: ''
35+
MAJOR_VERSION: '2'
36+
VERSION: '${MAJOR_VERSION}.${GITHUB_SHA}'
4637
VSCODE_VERSION: '1.38.1'
4738
MINIFY: 'true'
4839
PACKAGE: 'true'

.github/workflows/build-release.yml

Lines changed: 16 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,35 @@ on:
44
tags:
55
- '*'
66
jobs:
7-
8-
release_amd64:
9-
name: Release (AMD64 - CentOS 7 Target)
10-
runs-on: ubuntu-latest
7+
build:
8+
strategy:
9+
matrix:
10+
platform: [ubuntu-latest, macos-latest]
11+
linux-platforms: ['linux', 'alpine']
12+
runs-on: ${{ matrix.platform }}
1113
steps:
12-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@master
1315

14-
- name: Build code-server Binary
15-
run: yarn && bash ./scripts/ci.bash
16-
env:
17-
MAJOR_VERSION: '2'
18-
TARGET: 'linux'
19-
VERSION: '${MAJOR_VERSION}.${GITHUB_SHA}'
20-
VSCODE_VERSION: '1.38.1'
21-
MINIFY: 'true'
22-
PACKAGE: 'true'
23-
24-
- uses: ncipollo/release-action@v1
16+
- uses: actions/setup-node@v1
2517
with:
26-
artifacts: "release/*.tar.gz,release/*.zip"
27-
bodyFile: "CHANGELOG.md"
28-
token: ${{ secrets.GITHUB_TOKEN }}
18+
node-version: '10.x'
2919

30-
release_amd64_alpine:
31-
name: Build (AMD64 - Alpine Target)
32-
runs-on: ubuntu-latest
33-
steps:
34-
- uses: actions/checkout@v1
35-
36-
- name: Build code-server Binary
37-
run: yarn && bash ./scripts/ci.bash
20+
- name: Build code-server binary (Linux)
21+
run: bash ./scripts/ci.bash
3822
env:
3923
MAJOR_VERSION: '2'
40-
TARGET: 'alpine'
24+
TARGET: ${{ matrix.linux-platforms }}
4125
VERSION: '${MAJOR_VERSION}.${GITHUB_SHA}'
4226
VSCODE_VERSION: '1.38.1'
4327
MINIFY: 'true'
4428
PACKAGE: 'true'
45-
46-
- uses: ncipollo/release-action@v1
47-
with:
48-
artifacts: "release/*.tar.gz,release/*.zip"
49-
bodyFile: "CHANGELOG.md"
50-
token: ${{ secrets.GITHUB_TOKEN }}
51-
52-
release_macos:
53-
name: Build (macOS Target)
54-
runs-on: macOS-latest
55-
steps:
56-
- uses: actions/checkout@v1
5729

58-
- name: Workaround outdated Node in CI
59-
run: brew uninstall node@6 && brew install node@12
60-
61-
- name: Build code-server Binary
62-
run: yarn && bash ./scripts/ci.bash
30+
- name: Build code-server binary (macOS)
31+
if: contains( ${{ matrix.platform }} , 'macos-latest')
32+
run: bash ./scripts/ci.bash
6333
env:
6434
MAJOR_VERSION: '2'
65-
TARGET: 'linux'
6635
VERSION: '${MAJOR_VERSION}.${GITHUB_SHA}'
6736
VSCODE_VERSION: '1.38.1'
6837
MINIFY: 'true'
69-
PACKAGE: 'true'
70-
71-
- uses: ncipollo/release-action@v1
72-
with:
73-
artifacts: "release/*.tar.gz,release/*.zip"
74-
bodyFile: "CHANGELOG.md"
75-
token: ${{ secrets.GITHUB_TOKEN }}
38+
PACKAGE: 'true'

0 commit comments

Comments
 (0)