This commit is contained in:
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@@ -35,6 +35,7 @@ jobs:
|
||||
trimpath: true
|
||||
|
||||
- name: Create ZIP archive
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
cp -v ./config_example.ini ./build || exit 1
|
||||
pushd build || exit 1
|
||||
@@ -60,3 +61,24 @@ jobs:
|
||||
body: For test only
|
||||
name: ${{ github.ref_name }} Pre Release
|
||||
files: yggdrasil*.zip*
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: gardel/yggdrasil-go:latest, gardel/yggdrasil-go:${{ github.ref_name }}
|
||||
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM alpine:latest
|
||||
|
||||
LABEL maintainer="Gardel <sunxinao@hotmail.com>"
|
||||
LABEL "Description"="Go Yggdrasil Server"
|
||||
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
RUN mkdir -p /app
|
||||
COPY "build/yggdrasil-${TARGETOS}-${TARGETARCH}" /app/yggdrasil
|
||||
|
||||
EXPOSE 8080
|
||||
VOLUME /app/data
|
||||
|
||||
WORKDIR /app/data
|
||||
ENTRYPOINT ["/app/yggdrasil"]
|
4
Makefile
4
Makefile
@@ -1,5 +1,5 @@
|
||||
GO_CMD ?= go
|
||||
GO_BUILD = $(GO_CMD) build -trimpath -ldflags "-s -w"
|
||||
GO_BUILD = $(GO_CMD) build -trimpath -ldflags "-s -w -buildid="
|
||||
GO_CLEAN = $(GO_CMD) clean
|
||||
GO_TEST = $(GO_CMD) test
|
||||
GO_GET = $(GO_CMD) get
|
||||
@@ -11,7 +11,7 @@ PACKAGE_NAME = yggdrasil.tar.gz
|
||||
default: $(BINARY)
|
||||
|
||||
$(BINARY):
|
||||
$(GO_BUILD) -tags=nomsgpack -o $(BINARY)
|
||||
$(GO_BUILD) -tags='nomsgpack,sqlite,mysql' -o $(BINARY)
|
||||
|
||||
get:
|
||||
$(GO_GET)
|
||||
|
Reference in New Issue
Block a user