2022-11-29 10:58:22 -05:00
|
|
|
name: Make updated OS images available on release
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
description: "Semantic version tag of the release (vX.Y.Z)."
|
|
|
|
required: true
|
2022-12-09 05:51:38 -05:00
|
|
|
latest:
|
|
|
|
description: "Whether to update the latest tag."
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2022-11-29 10:58:22 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
update:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
contents: read
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
|
|
|
|
with:
|
|
|
|
ref: ${{ github.head_ref }}
|
|
|
|
|
|
|
|
- name: Setup Go environment
|
2022-12-02 04:33:19 -05:00
|
|
|
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
2022-11-29 10:58:22 -05:00
|
|
|
with:
|
2022-12-07 08:27:43 -05:00
|
|
|
go-version: "1.19.4"
|
2022-11-29 10:58:22 -05:00
|
|
|
cache: true
|
|
|
|
|
|
|
|
- name: Login to AWS
|
|
|
|
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
|
|
|
with:
|
|
|
|
role-to-assume: arn:aws:iam::795746500882:role/GithubAddReleaseVersion
|
|
|
|
aws-region: eu-central-1
|
|
|
|
|
|
|
|
- name: Update OS images
|
|
|
|
run: |
|
2022-12-09 05:51:38 -05:00
|
|
|
latest=$( [[ "${{ inputs.latest }}" = "true" ]] && echo "--latest")
|
|
|
|
go run main.go \
|
|
|
|
--version "${{ github.event.release.tag_name }}${{ github.event.inputs.tag }}" \
|
|
|
|
--stream stable \
|
|
|
|
--release \
|
|
|
|
"${latest}"
|
2022-11-29 10:58:22 -05:00
|
|
|
working-directory: hack/add-version
|