adjust actions

This commit is contained in:
xjasonlyu
2020-11-08 12:00:41 +08:00
parent 8c7075050c
commit 3b641119db
3 changed files with 13 additions and 5 deletions

View File

@@ -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: .

View File

@@ -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

View File

@@ -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=