From 32e1c461e5d3d25f4e248987ecc59672a1bfbd54 Mon Sep 17 00:00:00 2001 From: Duane May Date: Thu, 28 May 2026 16:39:17 -0400 Subject: [PATCH 1/3] Add Release GitHub Actions workflow --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..24840e8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +on: + release: + types: [created] + +permissions: + contents: write + packages: write + +jobs: + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 + goos: [ linux, windows, darwin ] + goarch: [ "386", amd64, arm64 ] + exclude: + - goarch: "386" + goos: darwin + - goarch: arm64 + goos: windows + steps: + - uses: actions/checkout@v4 + - uses: wangyoucao577/go-release-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + build_command: "make" + build_flags: "build" + binary_name: "uaa" + ldflags: "-I." From ada0a66ff3d6db1f4a25fc29b4581953f2e47e6c Mon Sep 17 00:00:00 2001 From: Duane May Date: Thu, 28 May 2026 16:43:40 -0400 Subject: [PATCH 2/3] Resolve Copilot Suggestions --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24840e8..1d7abaf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,6 @@ jobs: goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} build_command: "make" - build_flags: "build" - binary_name: "uaa" + build_flags: "build VERSION=${{ github.event.release.tag_name }}" + binary_name: "build/uaa" ldflags: "-I." From b5bd2afe26685e54eef9bab1c73909b88da6f9fc Mon Sep 17 00:00:00 2001 From: Duane May Date: Thu, 28 May 2026 16:56:02 -0400 Subject: [PATCH 3/3] Version bump and tagging in release workflow --- .github/workflows/release.yml | 72 +++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d7abaf..d9ba647 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,81 @@ +name: Ship Release + on: - release: - types: [created] + workflow_dispatch: + inputs: + bump_type: + description: 'Type of version bump (major, minor, or patch)' + required: true + type: choice + default: 'minor' + options: + - major + - minor + - patch + +run-name: "Ship ${{ inputs.bump_type }} Release" permissions: contents: write packages: write jobs: + versions: + name: Set Version and Tag + runs-on: ubuntu-latest + outputs: + version: ${{ steps.bump_semver.outputs.version }} + tag: ${{ steps.bump_semver.outputs.tag }} + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ github.ref_name }} + + - name: Get Latest Tag + id: get_latest_tag + run: | + version_prefix=${{ inputs.version_prefix }} + tag=$(git tag -l "v${version_prefix}.*" --sort=-v:refname | head -n 1) + tag=${tag:-v${version_prefix}.0.0} + echo "tag=${tag}" >> $GITHUB_OUTPUT + echo "🤔 *Previous tag: ${tag}*" >> $GITHUB_STEP_SUMMARY + + - name: Set Version and Tag + id: bump_semver + run: | + set -e + tag="${{ steps.get_latest_tag.outputs.tag }}" + # Remove leading 'v' + version=${tag#v} + # Split into major, minor, and patch + IFS=. read -r major minor patch <> $GITHUB_OUTPUT + echo "tag=${new_tag}" >> $GITHUB_OUTPUT + echo "### 👷 Building ${new_version}" >> $GITHUB_STEP_SUMMARY + + - name: Create and Push Tag + run: | + git config --global user.email "identity-uaa+ci@pivotal.io" + git config --global user.name "UAA Identity Bot" + git tag "${{ steps.bump_semver.outputs.tag }}" + git push origin "${{ steps.bump_semver.outputs.tag }}" + echo "🏷️ *Created and pushed tag: ${{ steps.bump_semver.outputs.tag }}*" >> $GITHUB_STEP_SUMMARY + releases-matrix: name: Release Go Binary runs-on: ubuntu-latest + needs: versions strategy: matrix: # build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 @@ -28,6 +94,6 @@ jobs: goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} build_command: "make" - build_flags: "build VERSION=${{ github.event.release.tag_name }}" + build_flags: "build VERSION=${{ needs.versions.outputs.version }}" binary_name: "build/uaa" ldflags: "-I."