Skip to content

Build and release

Build and release #61

name: Build and release
on:
workflow_dispatch:
inputs:
version:
description: Envoy version to build (don't include leading v)
type: string
required: true
permissions:
id-token: write
contents: write
jobs:
build:
strategy:
matrix:
os: [darwin, linux]
arch: [arm64, amd64]
uses: ./.github/workflows/build.yaml
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
version: ${{ inputs.version }}
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
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ inputs.version }}
draft: true
files: |
out/*