ci: Shift to github #7
Workflow file for this run
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: 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 }} |