-
Notifications
You must be signed in to change notification settings - Fork 66
142 lines (132 loc) · 3.96 KB
/
build.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
name: Envoy/build-tools
permissions:
contents: read
on:
push:
pull_request:
jobs:
env:
runs-on: ubuntu-20.04
outputs:
auth: ${{ steps.appauth.outputs.token }}
steps:
- id: appauth
uses: envoyproxy/toolshed/gh-actions/[email protected]
with:
key: ${{ secrets.ENVOY_CI_UPDATE_BOT_KEY }}
app_id: ${{ secrets.ENVOY_CI_UPDATE_APP_ID }}
build_container_linux:
runs-on: ubuntu-20.04
needs:
- env
strategy:
fail-fast: false
matrix:
include:
- target: ubuntu
OS_DISTRO: ubuntu
PUSH_GCR_IMAGE: true
GCR_IMAGE_NAME: envoy-build
- target: centos
OS_DISTRO: centos
PUSH_GCR_IMAGE: false
name: Build ${{ matrix.target }}
steps:
- uses: envoyproxy/toolshed/gh-actions/[email protected]
- name: 'Checkout Repository'
uses: actions/checkout@v3
- run: |
cd build_container
./docker_push.sh
env:
OS_FAMILY: linux
SOURCE_BRANCH: ${{ env.GITHUB_REF }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
build_container_windows:
name: Build windows
needs:
- env
runs-on: windows-2019
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- run: |
curl -fsSL --output "$TEMP/gcloud-sdk.zip" "$GCLOUD_SDK_ARCHIVE_URL"
echo "${GCLOUD_SDK_ARCHIVE_CHECKSUM} $TEMP/gcloud-sdk.zip" | sha256sum --check
unzip "$TEMP/gcloud-sdk.zip" -d "$PROGRAMFILES"
export PATH="${PROGRAMFILES}/google-cloud-sdk/bin:${PATH}"
shell: bash
env:
GCLOUD_SDK_ARCHIVE_URL: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-289.0.0-windows-x86_64.zip
GCLOUD_SDK_ARCHIVE_CHECKSUM: c81e80040f7f609dbc50c42cd0cd402988a5c47f467372d40b5aaca0733f46f4
- run: |
echo $PATH
cd build_container
./docker_push.sh
shell: bash
env:
OS_FAMILY: windows
SOURCE_BRANCH: ${{ env.GITHUB_REF }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
OS_DISTRO: windows2019
PUSH_GCR_IMAGE: false
GCR_IMAGE_NAME: envoy-build-windows
regenerate_linux:
runs-on: ubuntu-20.04
name: Regenerate toolchains (Linux)
needs:
- env
- build_container_linux
steps:
# Checkout the repo
- name: 'Checkout Repository (main)'
if: ${{ needs.env.outputs.auth }}
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
token: ${{ needs.env.outputs.auth }}
- name: 'Checkout Repository'
if: ${{ ! needs.env.outputs.auth }}
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
toolchains/regenerate.sh
env:
COMMIT_TOOLCHAINS: "${{ needs.env.outputs.auth && 'true' || 'false' }}"
GCR_IMAGE_NAME: envoy-build
OS_FAMILY: linux
SOURCE_BRANCH: ${{ env.GITHUB_REF }}
regenerate_windows:
runs-on: windows-2019
name: Regenerate toolchains (Windows)
needs:
- env
- build_container_windows
- regenerate_linux
steps:
- name: 'Checkout Repository (main)'
if: ${{ needs.env.outputs.auth }}
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
token: ${{ needs.env.outputs.auth }}
- name: 'Checkout Repository'
if: ${{ ! needs.env.outputs.auth }}
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
toolchains/regenerate.sh
shell: bash
env:
COMMIT_TOOLCHAINS: "${{ needs.env.outputs.auth && 'true' || 'false' }}"
GCR_IMAGE_NAME: envoy-build
OS_FAMILY: linux
SOURCE_BRANCH: ${{ env.GITHUB_REF }}