version 1.11.2 #29
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: Build and Publish Release | |
| permissions: | |
| contents: read | |
| packages: write | |
| on: | |
| push: | |
| tags: ['*'] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| GO111MODULE: on | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Run Gosec Security Scanner | |
| uses: securego/gosec@master | |
| with: | |
| args: ./... | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - name: Run Go tests | |
| run: go test ./... | |
| - name: Extract tag name | |
| id: get_tag | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@v4.0.0 | |
| with: | |
| cosign-release: 'v2.6.1' | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker Hub image | |
| uses: docker/build-push-action@v6 | |
| id: push-dockerhub | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
| push: true | |
| build-args: VERSION=${{ steps.get_tag.outputs.VERSION }} | |
| tags: | | |
| docker.io/wollomatic/socket-proxy:${{ steps.get_tag.outputs.VERSION }} | |
| docker.io/wollomatic/socket-proxy:1 | |
| - name: Sign Docker Hub image | |
| run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY docker.io/wollomatic/socket-proxy:${{ steps.get_tag.outputs.VERSION }}@${{ steps.push-dockerhub.outputs.digest }} | |
| env: | |
| COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} | |
| COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} | |
| - name: Build and push GHCR image | |
| uses: docker/build-push-action@v6 | |
| id: push-ghcr | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm/v7,linux/arm64 | |
| push: true | |
| build-args: VERSION=${{ steps.get_tag.outputs.VERSION }} | |
| tags: | | |
| ghcr.io/wollomatic/socket-proxy:${{ steps.get_tag.outputs.VERSION }} | |
| ghcr.io/wollomatic/socket-proxy:1 | |
| - name: Sign GHCR image | |
| run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY ghcr.io/wollomatic/socket-proxy:${{ steps.get_tag.outputs.VERSION }}@${{ steps.push-ghcr.outputs.digest }} | |
| env: | |
| COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} | |
| COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} |