-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (47 loc) · 1.36 KB
/
build-and-release.yaml
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
name: Build and release
on:
workflow_dispatch:
inputs:
version:
description: Envoy version to build (don't include leading v)
type: string
required: true
schedule:
- cron: 0 6 * * 1
permissions:
id-token: write
contents: write
jobs:
build:
strategy:
matrix:
os: [linux]
arch: [amd64]
fips: [false, true]
uses: ./.github/workflows/build.yaml
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
version: ${{ inputs.version || 'main' }}
package:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- run: |
mkdir out
for dir in envoy*; do
IFS=- read -r envoy os arch <<< "${dir}"
for bin in "${dir}"/*; do
chmod +x "${bin}"
bin="$(basename "${bin}")"
IFS=- read -r envoy suffix <<< "${bin}"
# We know the suffix begins with a version number
archive_name="envoy-${os}-${arch}-${suffix}"
# move file into tar.gz and rename to 'envoy' in archive
tar -C "${dir}" "--transform=flags=r;s|${bin}|envoy|" -czvf "out/${archive_name}.tar.gz" "${bin}"
done
done