Skip to content

Commit

Permalink
feat(ci): add release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: iverly <github@iverly.net>
  • Loading branch information
iverly committed Jan 8, 2024
1 parent 74f7148 commit f9a0733
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit f9a0733

Please sign in to comment.