refactor server command (#206)

This commit is contained in:
Sarv
2025-08-22 16:12:32 +08:00
committed by GitHub
parent 8f2830a9f1
commit cd8ddae8ee
27 changed files with 1234 additions and 690 deletions
+30 -18
View File
@@ -6,41 +6,53 @@ on:
- 'v*'
env:
ENABLE_UPX: 1
IMAGE_NAME: ${{ github.repository }}
jobs:
release:
name: Release Binary
name: Release Binary and Docker
runs-on: ubuntu-latest
container:
image: goreleaser/goreleaser-cross:v1.24
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git config --global --add safe.directory "$(pwd)"
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '^1.24'
- name: Cache go module
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Fix git permissions
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
run: goreleaser release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_UPX: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}