From f9a07332b7f83b900727111d533de7de58dcac2d Mon Sep 17 00:00:00 2001 From: iverly Date: Mon, 8 Jan 2024 12:51:23 +0100 Subject: [PATCH] feat(ci): add release workflow Signed-off-by: iverly --- .github/workflows/release.yaml | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..b9d71e2 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,74 @@ +name: Release + +on: + push: + tags: + - "v*" + +jobs: + docker: + concurrency: + group: docker + cancel-in-progress: false + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + kubecraft/kubecraft-proxy + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + id: build-and-push + uses: docker/build-push-action@v4 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64, linux/arm64 + provenance: true + sbom: true + + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: kubecraft/kubecraft-proxy + short-description: A reverse proxy for Minecraft server using gRPC for configuration. + + create-github-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get tag name + id: tag + run: echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/} + + - name: Create GitHub Release + uses: taiki-e/create-gh-release-action@v1 + with: + title: Release ${{ steps.tag.outputs.tag_name }} + token: ${{ secrets.GITHUB_TOKEN }}