From 82fba0ddb47c1f66cb659f775c120c08dd2b4447 Mon Sep 17 00:00:00 2001 From: "henry.chen" Date: Tue, 26 Oct 2021 16:17:50 +0800 Subject: [PATCH] fix(release): github action runner --- .github/workflows/release.yml | 5 ++++- scripts/run_build.sh | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c964cf4..eeee80f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: package: - runs-on: ubuntu-16.04 + runs-on: self-hosted steps: - name: Golang env uses: actions/setup-go@v2 @@ -35,6 +35,8 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} username: ${{ secrets.DOCKER_USERNAME }} - name: Build image + env: + GOPROXY: https://goproxy.io,direct run: scripts/run_build.sh deepzz0 ${{ steps.vars.outputs.tag }} - name: Package tar @@ -44,6 +46,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOPROXY: https://goproxy.io,direct with: files: | *.tar.gz diff --git a/scripts/run_build.sh b/scripts/run_build.sh index 25ad9df..a9fa389 100755 --- a/scripts/run_build.sh +++ b/scripts/run_build.sh @@ -1,7 +1,5 @@ #!/usr/bin/env sh -set -e - _registry="$1" _tag="$2" _platform="linux/amd64,linux/arm64,linux/386" @@ -11,11 +9,14 @@ if [ -z "$_registry" ] || [ -z "$_tag" ]; then exit 0; fi +# create and use builder +docker buildx inspect builder >/dev/null 2>&1 +if [ "$?" != "0" ]; then + docker buildx create --use --name builder +fi + # prepare dir ./bin mkdir -p ./bin -# create builder -docker buildx create --use --name builder - # build demo app for file in pkg/core/*; do app="$(basename $file)";