Build and release v #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and release | |
run-name: "Build ${{ !inputs.skip-release && 'and release ' || '' }}v${{ inputs.version }}" | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Envoy version to build (don't include leading v) | |
type: string | |
required: true | |
skip-release: | |
description: Skip the release? | |
type: boolean | |
required: false | |
schedule: | |
- cron: 0 6 * * 1 | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [darwin, linux, windows] | |
arch: [arm64, amd64] | |
fips: ['', 'fips'] | |
exclude: | |
- os: windows | |
fips: fips | |
- os: windows | |
arch: arm64 | |
- os: darwin | |
fips: fips | |
- os: linux | |
arch: arm64 | |
fips: fips | |
fail-fast: false | |
uses: ./.github/workflows/build.yaml | |
secrets: | |
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
with: | |
os: ${{ matrix.os }} | |
arch: ${{ matrix.arch }} | |
fips: ${{ matrix.fips == 'fips' }} | |
version: ${{ inputs.version || 'main' }} | |
package: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- run: | | |
mkdir out | |
for dir in envoy*; do | |
IFS=- read -r envoy os arch fips <<< "${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 | |
- name: Release | |
if: ${{ !inputs.skip-release }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ inputs.version || 'main' }} | |
draft: true | |
files: | | |
out/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: envoy-v${{ inputs.version }} | |
path: out/ | |
if-no-files-found: error |