|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +env: |
| 9 | + REGISTRY: ghcr.io |
| 10 | + |
| 11 | +jobs: |
| 12 | + release: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + contents: write |
| 16 | + packages: write |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Extract version from tag |
| 22 | + id: version |
| 23 | + run: echo "version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" |
| 24 | + |
| 25 | + - name: Log in to GHCR |
| 26 | + run: podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }} |
| 27 | + |
| 28 | + - name: Build bink binary |
| 29 | + run: | |
| 30 | + podman build --build-arg VERSION=${{ steps.version.outputs.version }} \ |
| 31 | + --target builder -t localhost/bink-builder:latest -f Containerfile . |
| 32 | + podman create --name bink-builder-tmp localhost/bink-builder:latest |
| 33 | + podman cp bink-builder-tmp:/output/bink ./bink |
| 34 | + podman rm bink-builder-tmp |
| 35 | + chmod +x ./bink |
| 36 | + ./bink version |
| 37 | +
|
| 38 | + - name: Build and push bink image |
| 39 | + run: | |
| 40 | + make build-bink-image VERSION=${{ steps.version.outputs.version }} |
| 41 | + podman tag ${{ env.REGISTRY }}/${{ github.repository }}/bink:latest \ |
| 42 | + ${{ env.REGISTRY }}/${{ github.repository }}/bink:${{ steps.version.outputs.version }} |
| 43 | + podman push ${{ env.REGISTRY }}/${{ github.repository }}/bink:${{ steps.version.outputs.version }} |
| 44 | + podman push ${{ env.REGISTRY }}/${{ github.repository }}/bink:latest |
| 45 | +
|
| 46 | + - name: Build and push cluster image |
| 47 | + run: | |
| 48 | + make build-cluster-image |
| 49 | + podman tag ${{ env.REGISTRY }}/${{ github.repository }}/cluster:latest \ |
| 50 | + ${{ env.REGISTRY }}/${{ github.repository }}/cluster:${{ steps.version.outputs.version }} |
| 51 | + podman push ${{ env.REGISTRY }}/${{ github.repository }}/cluster:${{ steps.version.outputs.version }} |
| 52 | + podman push ${{ env.REGISTRY }}/${{ github.repository }}/cluster:latest |
| 53 | +
|
| 54 | + - name: Build and push dns image |
| 55 | + run: | |
| 56 | + make build-dns-image |
| 57 | + podman tag ${{ env.REGISTRY }}/${{ github.repository }}/dns:latest \ |
| 58 | + ${{ env.REGISTRY }}/${{ github.repository }}/dns:${{ steps.version.outputs.version }} |
| 59 | + podman push ${{ env.REGISTRY }}/${{ github.repository }}/dns:${{ steps.version.outputs.version }} |
| 60 | + podman push ${{ env.REGISTRY }}/${{ github.repository }}/dns:latest |
| 61 | +
|
| 62 | + - name: Create GitHub Release |
| 63 | + env: |
| 64 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + run: | |
| 66 | + gh release create ${{ steps.version.outputs.version }} \ |
| 67 | + ./bink \ |
| 68 | + --title "${{ steps.version.outputs.version }}" \ |
| 69 | + --generate-notes |
0 commit comments