-
Notifications
You must be signed in to change notification settings - Fork 157
171 lines (168 loc) · 5.31 KB
/
ci.yml
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
# Set the workflow name.
name: CI
# Execute the workflow on pushes and pull requests.
on: [push, pull_request]
# Define the workflow jobs.
jobs:
verification:
name: Commit Verification
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "Perform commit verification"
run: |
# Determine the target commit range.
export VERIFY_COMMIT_START="${{ github.event.pull_request.base.sha }}"
export VERIFY_COMMIT_END="${{ github.event.pull_request.head.sha }}"
# Perform verification.
scripts/ci/verify_commits.sh
macos:
name: macOS
runs-on: macos-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.21.5'
- name: "Install sha256sum"
run: brew install coreutils
- run: scripts/ci/setup_go.sh
- run: scripts/ci/setup_ssh.sh
- run: scripts/ci/setup_partitions_darwin.sh
- run: scripts/ci/analyze.sh
- run: scripts/ci/test.sh
- run: scripts/ci/build.sh
env:
MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
MACOS_CODESIGN_CERTIFICATE_AND_KEY: ${{ secrets.MACOS_CODESIGN_CERTIFICATE_AND_KEY }}
MACOS_CODESIGN_CERTIFICATE_AND_KEY_PASSWORD: ${{ secrets.MACOS_CODESIGN_CERTIFICATE_AND_KEY_PASSWORD }}
- run: scripts/ci/notarize.sh
if: github.ref_type == 'tag'
env:
MACOS_NOTARIZE_APPLE_ID: ${{ secrets.MACOS_NOTARIZE_APPLE_ID }}
MACOS_NOTARIZE_APP_SPECIFIC_PASSWORD: ${{ secrets.MACOS_NOTARIZE_APP_SPECIFIC_PASSWORD }}
MACOS_NOTARIZE_TEAM_ID: ${{ secrets.MACOS_NOTARIZE_TEAM_ID }}
- run: scripts/ci/sha256sum.sh
- uses: crazy-max/ghaction-import-gpg@v3
id: import_gpg
if: github.ref_type == 'tag'
with:
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
passphrase: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
- run: scripts/ci/sha256sign.sh
if: github.ref_type == 'tag'
env:
SHA256_GPG_SIGNING_IDENTITY: ${{ steps.import_gpg.outputs.email }}
- uses: actions/upload-artifact@v2
with:
name: bundles
path: build/release/*
retention-days: 2
linux:
name: Linux
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
goversion: ['1.20.12', '1.21.5']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.goversion }}
- run: scripts/ci/setup_go.sh
- run: scripts/ci/setup_ssh.sh
- run: scripts/ci/setup_docker.sh
- run: scripts/ci/analyze.sh
- run: scripts/ci/test.sh
- run: scripts/ci/test_386.sh
- run: scripts/ci/build.sh
windows:
name: Windows
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.21.5'
- run: scripts/ci/setup_go.sh
shell: bash
- run: scripts/ci/setup_docker.sh
shell: bash
- run: diskpart /s scripts\ci\setup_partitions_windows.txt
- run: scripts/ci/analyze.sh
shell: bash
- run: scripts/ci/test.sh
shell: bash
- run: scripts/ci/test_386.sh
shell: bash
- run: scripts/ci/build.sh
shell: bash
sidecar:
name: Sidecar
runs-on: ubuntu-latest
needs: [macos, linux, windows]
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.21.5'
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
if: github.ref_type == 'tag'
with:
username: ${{ secrets.SIDECAR_DEPLOYMENT_USER }}
password: ${{ secrets.SIDECAR_DEPLOYMENT_TOKEN }}
- name: "Determine sidecar tag"
id: tag
run: echo ::set-output name=tag::$(go run scripts/ci/sidecar_tag.go)
- uses: docker/build-push-action@v2
with:
file: images/sidecar/linux/Dockerfile
target: mit
tags: ${{ steps.tag.outputs.tag }}
push: ${{ github.ref_type == 'tag' }}
platforms: |
linux/386
linux/amd64
linux/arm/v6
linux/arm/v7
linux/arm64/v8
linux/ppc64le
- uses: docker/build-push-action@v2
with:
file: images/sidecar/linux/Dockerfile
target: sspl
tags: ${{ steps.tag.outputs.tag }}-sspl
push: ${{ github.ref_type == 'tag' }}
platforms: |
linux/386
linux/amd64
linux/arm/v6
linux/arm/v7
linux/arm64/v8
linux/ppc64le
release:
name: Release
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: [macos, linux, windows, sidecar]
timeout-minutes: 10
steps:
- uses: actions/download-artifact@v2
with:
name: bundles
path: bundles
- uses: alexellis/upload-assets@0.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["bundles/*"]'