chore(deps): bump rexml from 3.3.3 to 3.3.6 in /infra/build/developer… #1
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 new CLI versions | |
on: | |
push: | |
branches: | |
- "master" | |
paths: | |
- "cli/Makefile" | |
- ".github/workflows/release-cli.yml" | |
env: | |
CLI_BUCKET: gs://cft-cli | |
RELEASE_URL: https://api.github.com/repos/GoogleCloudPlatform/cloud-foundation-toolkit/releases/latest | |
jobs: | |
release-new-cli: | |
name: Release new CLI versions | |
runs-on: ubuntu-latest | |
if: github.repository == 'GoogleCloudPlatform/cloud-foundation-toolkit' | |
permissions: | |
contents: 'write' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version-file: cli/go.mod | |
cache-dependency-path: cli/go.sum | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@62cf5bd3e4211a0a0b51f2c6d6a37129d828611d' # v2.1.5 | |
with: | |
workload_identity_provider: '${{ secrets.GCP_WIF_PROVIDER }}' | |
service_account: '${{ secrets.GCP_WIF_SA_EMAIL }}' | |
- uses: google-github-actions/setup-gcloud@f0990588f1e5b5af6827153b93673613abdc6ec7 # v2.1.1 | |
with: | |
version: "410.0.0" | |
# used by make release which runs gcloud alpha storage | |
- name: Install gcloud alpha commands | |
run: gcloud components install alpha | |
- name: Retrieve last released version | |
run: |- | |
LAST_VERSION=$(curl --silent "${{env.RELEASE_URL}}" | \ | |
jq --raw-output .tag_name) | |
echo "LAST_VERSION=${LAST_VERSION}" >> $GITHUB_ENV | |
- name: Build | |
working-directory: ./cli | |
run: |- | |
make release | |
chmod +x bin/* | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
name: bin | |
path: cli/bin | |
- name: Retrieve current version | |
working-directory: ./cli | |
run: |- | |
CURRENT_VERSION=$(./bin/cft-linux-amd64 version) | |
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | |
- name: Release new version | |
if: env.LAST_VERSION != env.CURRENT_VERSION | |
working-directory: ./cli | |
run: |- | |
make publish | |
- name: Create Release | |
if: env.LAST_VERSION != env.CURRENT_VERSION | |
id: create_release | |
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: cli/${{ env.CURRENT_VERSION }} | |
release_name: CLI Release ${{ env.CURRENT_VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload Linux Release | |
if: env.LAST_VERSION != env.CURRENT_VERSION | |
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cli/bin/cft-linux-amd64 | |
asset_name: cft-linux-amd64 | |
asset_content_type: application/octet-stream | |
- name: Upload Darwin Release | |
if: env.LAST_VERSION != env.CURRENT_VERSION | |
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cli/bin/cft-darwin-amd64 | |
asset_name: cft-darwin-amd64 | |
asset_content_type: application/octet-stream | |
- name: Upload Windows Release | |
if: env.LAST_VERSION != env.CURRENT_VERSION | |
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./cli/bin/cft-windows-amd64 | |
asset_name: cft-windows-amd64 | |
asset_content_type: application/octet-stream |