release: 1.34.5 - halyard: 1.45 / 1.65.0 - dry run: false #151
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: Release | |
run-name: 'release: ${{ inputs.spinnakerVersion }} - halyard: ${{ inputs.minimumHalyardVersion }} / ${{ inputs.latestHalyardVersion }} - dry run: ${{ inputs.dryRun }}' | |
on: | |
workflow_dispatch: | |
inputs: | |
spinnakerVersion: | |
description: 'Spinnaker release version, for example: 1.30.0 or 1.30.1' | |
type: string | |
required: true | |
minimumHalyardVersion: | |
description: 'Minimum Halyard version required for release, "major.minor", For example: 1.45' | |
default: '1.45' | |
type: string | |
required: true | |
latestHalyardVersion: | |
description: 'Latest Halyard version to use, "major.minor.patch", For example: 1.45.0' | |
default: '1.54.0' | |
type: string | |
required: true | |
dryRun: | |
description: 'Perform a dry run without publishing to git or artifact repositories.' | |
default: 'true' | |
options: | |
- 'true' | |
- 'false' | |
type: choice | |
required: true | |
tagJava11: | |
description: 'Tag Java 11 variants of images. Only set to True for versions after 1.32.0.' | |
default: 'true' | |
options: | |
- 'true' | |
- 'false' | |
type: choice | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
cache: 'pip' | |
- name: Install dependencies with pip | |
run: | | |
pip install -r dev/requirements.txt | |
pip install -r dev/buildtool/requirements.txt | |
- name: Install regctl for container image tagging | |
run: | | |
curl -L https://github.com/regclient/regclient/releases/download/v0.4.5/regctl-linux-amd64 >regctl | |
install --mode 755 regctl /usr/local/bin/ | |
regctl version | |
- name: Setup git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Spinnaker GHA" | |
- name: Assemble release info | |
id: release_info | |
run: | | |
echo REPOSITORY_OWNER="${GITHUB_REPOSITORY%/*}" >> $GITHUB_OUTPUT | |
echo "Running publish_spinnaker for: | |
release version: ${{ inputs.spinnakerVersion }} | |
minimum Halyard version: ${{ inputs.minimumHalyardVersion }} | |
latest Halyard version: ${{ inputs.latestHalyardVersion }} | |
dry run enabled: ${{ inputs.dryRun }} | |
tag Java 11 variants: ${{ inputs.tagJava11 }}" | |
- name: Login to GAR | |
# This is required to tag docker images | |
# | |
# Only run this on repositories in the 'spinnaker' org, not on forks. | |
if: startsWith(github.repository, 'spinnaker/') | |
uses: docker/login-action@v3 | |
# use service account flow defined at: https://github.com/docker/login-action#service-account-based-authentication-1 | |
with: | |
registry: us-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GAR_JSON_KEY }} | |
- name: Login to Google Cloud | |
# This is required to publish the bom and versions file | |
# | |
# Only run this on repositories in the 'spinnaker' org, not on forks. | |
if: startsWith(github.repository, 'spinnaker/') | |
uses: 'google-github-actions/auth@v2' | |
# use service account flow defined at: https://github.com/google-github-actions/upload-cloud-storage#authenticating-via-service-account-key-json | |
with: | |
credentials_json: '${{ secrets.GAR_JSON_KEY }}' | |
- name: Publish release | |
run: | | |
./dev/buildtool.sh \ | |
publish_spinnaker \ | |
--spinnaker_version "${{ inputs.spinnakerVersion }}" \ | |
--minimum_halyard_version "${{ inputs.minimumHalyardVersion }}" \ | |
--latest_halyard_version "${{ inputs.latestHalyardVersion }}" \ | |
--github_owner "${{ steps.release_info.outputs.REPOSITORY_OWNER }}" \ | |
--github_oauth_token "${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}" \ | |
--dry_run ${{ inputs.dryRun }} \ | |
--tag_java11 ${{ inputs.tagJava11 }} | |
- name: Cat output files for review | |
run: | | |
for f in \ | |
output/build_bom/*.yml \ | |
output/publish_spinnaker/changelog.md \ | |
output/update_versions/versions.yml \ | |
; do echo -e "\n*** ${f} ***"; cat "${f}"; done | |
- name: Attach output files to GHA Job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: spinnaker_release_${{ inputs.spinnakerVersion }} | |
path: | | |
output/build_bom/*.yml | |
output/publish_spinnaker/changelog.md | |
output/update_versions/versions.yml |