Release #3
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Extract version | |
| id: version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $VERSION" | |
| - name: Generate changelog | |
| id: changelog | |
| uses: metcalfc/changelog-generator@v4.4.0 | |
| with: | |
| myToken: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build binaries | |
| run: | | |
| mkdir -p dist | |
| GOOS=linux GOARCH=amd64 go build -o dist/karpenter-optimizer-api-linux-amd64 ./cmd/api | |
| GOOS=linux GOARCH=arm64 go build -o dist/karpenter-optimizer-api-linux-arm64 ./cmd/api | |
| GOOS=darwin GOARCH=amd64 go build -o dist/karpenter-optimizer-api-darwin-amd64 ./cmd/api | |
| GOOS=darwin GOARCH=arm64 go build -o dist/karpenter-optimizer-api-darwin-arm64 ./cmd/api | |
| GOOS=windows GOARCH=amd64 go build -o dist/karpenter-optimizer-api-windows-amd64.exe ./cmd/api | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ steps.version.outputs.version }} | |
| body: | | |
| ## Changes in this Release | |
| ${{ steps.changelog.outputs.changelog }} | |
| ## Docker Images | |
| - `ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}` | |
| - `ghcr.io/${{ github.repository }}-frontend:${{ steps.version.outputs.version }}` | |
| ## Binaries | |
| Pre-built binaries are available in the assets below for Linux (amd64/arm64), macOS (amd64/arm64), and Windows (amd64). | |
| files: | | |
| dist/karpenter-optimizer-api-linux-amd64 | |
| dist/karpenter-optimizer-api-linux-arm64 | |
| dist/karpenter-optimizer-api-darwin-amd64 | |
| dist/karpenter-optimizer-api-darwin-arm64 | |
| dist/karpenter-optimizer-api-windows-amd64.exe | |
| draft: false | |
| prerelease: false | |