diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2251091..bf2c47a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -38,12 +38,23 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and Push (dev) + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: | + xjasonlyu/tun2socks:dev + - name: Get Version id: shell run: | echo ::set-output name=version::$(git describe --tags --abbrev=0) - - name: Build and Push + - name: Build and Push (latest) + if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v2 with: context: . diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3294fd5..b788341 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -45,9 +45,6 @@ jobs: - name: Build if: startsWith(github.ref, 'refs/tags/') - env: - DIR: bin - NAME: tun2socks run: make -j releases - name: Upload Release diff --git a/Makefile b/Makefile index 20a32bc..40a9cf0 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NAME = "tun2socks" TAGS = "" BUILD_FLAGS = "-v" -VERSION = $(shell git describe --tags --abbrev=0 || echo "unknown version") +VERSION = $(shell git describe --tags || echo "unknown version") BUILD_TIME = $(shell date -u '+%FT%TZ') LDFLAGS += -w -s -buildid=