Chore: update build
This commit is contained in:
parent
3dbba5d8d2
commit
0563abae13
36
.github/workflows/release.yml
vendored
36
.github/workflows/release.yml
vendored
@ -38,24 +38,24 @@ jobs:
|
||||
go test ./...
|
||||
|
||||
- name: Build
|
||||
#if: startsWith(github.ref, 'refs/tags/')
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
NAME: clash
|
||||
BINDIR: bin
|
||||
run: make -j releases
|
||||
|
||||
- name: Prepare upload
|
||||
run: |
|
||||
echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
|
||||
echo "FILE_SHA=$(git describe --tags --always 2>/dev/null)" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload files to Artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
if: startsWith(github.ref, 'refs/tags/') == false
|
||||
with:
|
||||
name: clash_${{ env.FILE_SHA }}${{ env.FILE_DATE }}
|
||||
path: |
|
||||
bin/*
|
||||
#- name: Prepare upload
|
||||
# run: |
|
||||
# echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
|
||||
# echo "FILE_SHA=$(git describe --tags --always 2>/dev/null)" >> $GITHUB_ENV
|
||||
#
|
||||
#- name: Upload files to Artifacts
|
||||
# uses: actions/upload-artifact@v2
|
||||
# if: startsWith(github.ref, 'refs/tags/') == false
|
||||
# with:
|
||||
# name: clash_${{ env.FILE_SHA }}${{ env.FILE_DATE }}
|
||||
# path: |
|
||||
# bin/*
|
||||
|
||||
- name: Upload Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
@ -66,8 +66,8 @@ jobs:
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
|
||||
- name: Delete workflow runs
|
||||
uses: GitRML/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
#- name: Delete workflow runs
|
||||
# uses: GitRML/delete-workflow-runs@main
|
||||
# with:
|
||||
# retain_days: 1
|
||||
# keep_minimum_runs: 2
|
||||
|
6
Makefile
6
Makefile
@ -1,6 +1,6 @@
|
||||
NAME=clash
|
||||
BINDIR=bin
|
||||
VERSION=$(shell git describe --tags --always 2>/dev/null || date +%F)
|
||||
VERSION=$(shell git describe --tags --always 2>/dev/null || echo "unknown version")
|
||||
BUILDTIME=$(shell date -u)
|
||||
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version=$(VERSION)" \
|
||||
-X "github.com/Dreamacro/clash/constant.BuildTime=$(BUILDTIME)" \
|
||||
@ -16,7 +16,7 @@ PLATFORM_LIST = \
|
||||
linux-armv5 \
|
||||
linux-armv6 \
|
||||
linux-armv7 \
|
||||
linux-arm64 \
|
||||
linux-armv8 \
|
||||
linux-mips-softfloat \
|
||||
linux-mips-hardfloat \
|
||||
linux-mipsle-softfloat \
|
||||
@ -67,7 +67,7 @@ linux-armv6:
|
||||
linux-armv7:
|
||||
GOARCH=arm GOOS=linux GOARM=7 $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
|
||||
|
||||
linux-arm64:
|
||||
linux-armv8:
|
||||
GOARCH=arm64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
|
||||
|
||||
linux-mips-softfloat:
|
||||
|
Reference in New Issue
Block a user