v2.12.2 #532
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: main | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: [created] | |
| jobs: | |
| determine-version: | |
| name: Determine version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - id: determine_version | |
| run: | | |
| if [ ${{ github.event_name }} == "release" ]; then | |
| echo "version=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "version=${{ github.sha }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| cat "$GITHUB_OUTPUT" | |
| outputs: | |
| version: ${{ steps.determine_version.outputs.version }} | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [ determine-version ] | |
| steps: | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: actions/checkout@v4 | |
| - name: Lint | |
| run: make lint | |
| - name: Format | |
| run: make format && git diff --exit-code | |
| - name: Test | |
| run: make test | |
| - name: Build | |
| run: make package_all VERSION=${{ needs.determine-version.outputs.version }} | |
| - name: Docker Hub authentication | |
| if: github.event_name != 'pull_request' && github.repository == 'jthomperoo/custom-pod-autoscaler' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USER }} | |
| password: ${{ secrets.DOCKER_PASS }} | |
| - name: Build Docker images | |
| if: github.event_name != 'pull_request' && github.repository == 'jthomperoo/custom-pod-autoscaler' | |
| run: make docker_multi_platform VERSION=${{ needs.determine-version.outputs.version }} | |
| - name: Tag latest Docker images | |
| if: github.event_name == 'release' | |
| run: make docker_tag_latest | |
| - name: Publish binaries | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| custom-pod-autoscaler.tar.gz | |
| custom-pod-autoscaler-linux-386.tar.gz | |
| custom-pod-autoscaler-linux-amd64.tar.gz | |
| custom-pod-autoscaler-linux-arm.tar.gz | |
| custom-pod-autoscaler-linux-arm64.tar.gz | |
| custom-pod-autoscaler-darwin-amd64.tar.gz | |
| custom-pod-autoscaler-darwin-arm64.tar.gz | |
| custom-pod-autoscaler-windows-386.tar.gz | |
| custom-pod-autoscaler-windows-amd64.tar.gz |