Compare commits

...

6 Commits

Author SHA1 Message Date
4bfc783577 chore: modify makefile 2022-05-01 13:10:30 +08:00
bfc0c9ecba chore: modify github workflows 2022-05-01 12:56:21 +08:00
66e74259b1 chore: modify github workflows 2022-05-01 12:23:08 +08:00
c0407fe4c9 chore: modify github workflows 2022-05-01 12:22:12 +08:00
394a297368 chore: modify github workflows 2022-05-01 11:58:06 +08:00
10a9eab542 chore: modify github workflows 2022-05-01 11:56:45 +08:00
3 changed files with 14 additions and 19 deletions

View File

@ -1,4 +1,4 @@
name: prerelease
name: prerelease-test
on:
push:
branches:
@ -34,7 +34,7 @@ jobs:
- name: Test
if: ${{env.GITHUB_REF_NAME=='Beta'}}
run: |
go test ./..
go test ./...
- name: Build
if: success()
env:
@ -61,7 +61,7 @@ jobs:
if: ${{ success() }}
with:
tag: ${{env.GITHUB_REF_NAME}}
tag_name: alpha
tag_name: ${{env.GITHUB_REF_NAME}}
files: bin/*
prerelease: true
generate_release_notes: true

View File

@ -1,4 +1,4 @@
name: alpha
name: release-test
on:
push:
tags:
@ -27,7 +27,7 @@ jobs:
${{ runner.os }}-go-
- name: Test
run: |
go test ./..
go test ./...
- name: Build
if: success()
env:
@ -35,20 +35,6 @@ jobs:
BINDIR: bin
run: make -j releases
- name: Delete current release assets
uses: andreaswilli/delete-release-assets-action@v2.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: beta
deleteOnlyFromDrafts: false
- name: Tag Repo
uses: richardsimko/update-tag@v1
with:
tag_name: beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Alpha
uses: softprops/action-gh-release@v1
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}}

View File

@ -1,7 +1,16 @@
NAME=Clash.Meta
BINDIR=bin
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(BRANCH),Alpha)
VERSION=alpha-$(shell git rev-parse --short HEAD)
else ifeq ($(BRANCH),Beta)
VERSION=beta-$(shell git rev-parse --short HEAD)
else ifeq ($(BRANCH),Meta)
VERSION=$(shell git describe --tags)
else
VERSION=unknown
endif
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)" \