Skip to content

Create release

Create release #1177

Workflow file for this run

name: Create release
on:
schedule:
- cron: "0 5 * * *" # Once a day at 5am.
# Manual runs through Actions tab in the UI
workflow_dispatch:
permissions:
actions: read
contents: write
id-token: write
pull-requests: read
# Cancel previous runs if a new one is started.
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
create_release:
runs-on: ubuntu-22.04
steps:
# Check out repo at latest green postsubmit commit on the main branch.
- name: Get latest passing commit
id: latest-green
env:
REPO: ${{ github.repository }}
run: |
set -euo pipefail
output=$(curl --fail-with-body -sS \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$REPO/actions/workflows/postsubmit.yml/runs?per_page=1&branch=main&event=schedule&status=success")
repo_id=$(jq -r '.workflow_runs[0].head_repository.id' <<< $output)
if [[ "${repo_id}" != "${{ github.repository_id }}" ]] ; then
echo >&2 "Unexpected head repository ID: ${repo_id} - check postsubmit.yml configuration"
exit 1
fi
sha=$(jq -r '.workflow_runs[0].head_sha' <<< $output)
echo "latest_green=$sha" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
with:
ref: ${{ steps.latest-green.outputs.latest_green }}
- name: Auth
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # tag=v3.0.0
with:
create_credentials_file: true # also sets GOOGLE_APPLICATION_CREDENTIALS
service_account: "github-automation-bot@gha-crc-prod.iam.gserviceaccount.com"
workload_identity_provider: "projects/695270090783/locations/global/workloadIdentityPools/github-automation/providers/crc-prod"
- name: "Set up gcloud"
uses: "google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db" # tag=v3.0.1
with:
skip_install: true
- name: Deploy Navtest on Cloud Build
run: |
gcloud builds submit \
--project robco-navtest \
--config .github/ci/deploy_navtest_cloudbuild.yaml
# Now we are ready to create the release.
- name: Run release_binary.sh
env:
REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FULL_SHA: ${{ steps.latest-green.outputs.latest_green }}
run: ./.github/ci/release_binary.sh