Release #32
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 | |
| permissions: | |
| contents: write | |
| packages: write | |
| pages: write | |
| deployments: write | |
| pull-requests: write | |
| issues: write | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| goreleaser: | |
| if: true # false to skip job during debug | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Golang | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.26' | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v6 | |
| - name: Unshallow | |
| run: git fetch --prune --unshallow | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| - name: Setup Protobuf | |
| uses: ./.github/actions/setup-protobuf | |
| - name: Generate protobuf files | |
| run: go generate ./api/pb/ | |
| - name: Release via goreleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| args: release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| docker: | |
| name: Build and Push Docker Images | |
| if: true # false to skip job during debug | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: [ | |
| {file: 'docker/Dockerfile', name: 'cybertecpostgresql/pgwatch'}, | |
| {file: 'docker/demo/Dockerfile', name: 'cybertecpostgresql/pgwatch-demo'} | |
| ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out source code | |
| uses: actions/checkout@v6 | |
| - name: Prepare build metadata | |
| id: meta | |
| run: | | |
| echo "GIT_HASH=${{ github.sha }}" >> $GITHUB_OUTPUT | |
| echo "GIT_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT | |
| echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
| echo "SHOULD_PUSH=${{ github.ref_type == 'tag' }}" >> $GITHUB_OUTPUT | |
| - name: Build and push Docker image | |
| uses: ./.github/actions/build-docker | |
| with: | |
| dockerfile: ${{ matrix.image.file }} | |
| image-name: ${{ matrix.image.name }} | |
| registry: docker.io | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| platforms: linux/amd64,linux/arm64 | |
| push: ${{ steps.meta.outputs.SHOULD_PUSH }} | |
| cache-scope: shared-release | |
| build-args: | | |
| GIT_HASH=${{ steps.meta.outputs.GIT_HASH }} | |
| GIT_TIME=${{ steps.meta.outputs.GIT_TIME }} | |
| VERSION=${{ steps.meta.outputs.VERSION }} |