|
8 | 8 |
|
9 | 9 | permissions: |
10 | 10 | contents: write |
| 11 | + packages: write |
11 | 12 |
|
12 | 13 | jobs: |
13 | 14 | goreleaser: |
|
34 | 35 | args: release --clean --verbose -f goreleaser.yaml ${{ env.flags }} |
35 | 36 | env: |
36 | 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + - name: Set up QEMU |
| 39 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 40 | + uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0 |
| 41 | + - name: Set up Docker Buildx |
| 42 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 43 | + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 |
| 44 | + - name: Log in to GitHub Container Registry |
| 45 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 46 | + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 |
| 47 | + with: |
| 48 | + registry: ghcr.io |
| 49 | + username: ${{ github.actor }} |
| 50 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + - name: Docker metadata |
| 52 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 53 | + id: meta |
| 54 | + uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0 |
| 55 | + with: |
| 56 | + images: ghcr.io/${{ github.repository }} |
| 57 | + tags: | |
| 58 | + type=semver,pattern={{version}} |
| 59 | + type=semver,pattern={{major}}.{{minor}} |
| 60 | + type=raw,value=latest |
| 61 | + - name: Prepare binaries for container image |
| 62 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 63 | + env: |
| 64 | + VERSION: ${{ github.ref_name }} |
| 65 | + run: | |
| 66 | + cp "dist/pipeleek_${VERSION}_linux_amd64" pipeleek_amd64 |
| 67 | + cp "dist/pipeleek_${VERSION}_linux_arm64" pipeleek_arm64 |
| 68 | + chmod +x pipeleek_amd64 pipeleek_arm64 |
| 69 | + - name: Build and push container image |
| 70 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 71 | + uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 |
| 72 | + with: |
| 73 | + context: . |
| 74 | + platforms: linux/amd64,linux/arm64 |
| 75 | + push: true |
| 76 | + tags: ${{ steps.meta.outputs.tags }} |
| 77 | + labels: ${{ steps.meta.outputs.labels }} |
37 | 78 | - name: Upload assets |
38 | 79 | uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
39 | 80 | with: |
|
0 commit comments