Release CLI and Terraform #144
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: Release CLI and Terraform | |
on: | |
workflow_dispatch: | |
inputs: | |
runCLI: | |
description: "Run deploy of CLI" | |
type: boolean | |
required: false | |
concurrency: | |
group: ci-check-${{ github.ref }} | |
jobs: | |
build: | |
runs-on: ${{ vars.RUNNER_RUNS_ON }} | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 1 | |
token: ${{ secrets.GH_PAT2 }} | |
- name: Set up Go | |
uses: actions/[email protected] | |
with: | |
cache-dependency-path: "**/go.sum" | |
go-version: ${{ vars.GO_VERSION }} # settings > secrets and variables > variables > GO_VERSION | |
- name: Check version candidate | |
run: ./scripts/check_release_v2.sh ${{ github.ref_name }} | |
- run: go version | |
cli-release: | |
needs: build | |
runs-on: ${{ vars.RUNNER_RUNS_ON }} | |
timeout-minutes: 10 | |
if: ${{ inputs.runCLI }} | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_PAT2 }} | |
- name: Set up Go | |
uses: actions/[email protected] | |
with: | |
cache-dependency-path: "**/go.sum" | |
go-version: ${{ vars.GO_VERSION }} # settings > secrets and variables > variables > GO_VERSION | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: '2' | |
args: release --clean --config="goreleaser_cli.yaml" | |
env: | |
VERSION: ${{ github.ref_name }} | |
GITHUB_TOKEN: ${{ secrets.GH_PAT2 }} | |
PRIVATE_KEY_PATH: ${{ secrets.SSH_ID_RSA_MAGALUCLI }} | |
- name: Set up Git config | |
run: | | |
git config --global user.name "Magalu Cloud" | |
git config --global user.email "[email protected]" | |
- name: Setup GitHub CLI | |
uses: ksivamuthu/actions-setup-gh-cli@v3 | |
- name: Create Pull Request | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT2 }} | |
run: | | |
gh pr create \ | |
--repo MagaluCloud/homebrew-mgccli \ | |
--title "🚀 Update mgccli brew formula to version ${{ github.ref_name }}" \ | |
--body "This PR updates the mgccli formula to version ${{ github.ref_name }}." \ | |
--base main \ | |
--head mgccli-${{ github.ref_name }} |