From 7e9115dc648cd8872b4dd223cff6ccd1df26d87c Mon Sep 17 00:00:00 2001 From: xmdhs Date: Thu, 12 Oct 2023 00:48:06 +0800 Subject: [PATCH] release ci --- .github/workflows/release.yaml | 36 ++++++++++++++++++++++++++++++++++ build.sh | 6 +----- build_frontend.sh | 6 ++++++ 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yaml create mode 100644 build_frontend.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ae00c1b --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,36 @@ +on: + release: + types: [created] + +permissions: + contents: write + packages: write + +jobs: + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 + goos: [linux, windows, darwin] + goarch: ["386", amd64, arm64, "arm"] + exclude: + - goarch: "386" + goos: darwin + - goarch: arm + goos: windows + steps: + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1 + with: + pre_command: bash build_frontend.sh + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + project_path: "./cmd/authlibskin" + binary_name: "authlibskin" + extra_files: LICENSE README.md + executable_compression: upx + build_flags: -tags="redis,sqlite" + ldflags: -w -s \ No newline at end of file diff --git a/build.sh b/build.sh index 295d1ce..01e31b1 100644 --- a/build.sh +++ b/build.sh @@ -1,9 +1,5 @@ #!/bin/bash -cd frontend -npm install -g pnpm -pnpm install -pnpm build -cp -r dist ../server/static/files +bash ./build_frontend.sh cd ../cmd/authlibskin go build -trimpath -ldflags "-w -s" -tags="redis,sqlite" -o out/authlibskin diff --git a/build_frontend.sh b/build_frontend.sh new file mode 100644 index 0000000..965c8aa --- /dev/null +++ b/build_frontend.sh @@ -0,0 +1,6 @@ +#!/bin/bash +cd frontend +npm install -g pnpm +pnpm install +pnpm build +cp -r dist ../server/static/files \ No newline at end of file