增加协议屏蔽支持

This commit is contained in:
qaq
2025-08-17 22:19:35 +08:00
parent 86988b48f9
commit 04a0ffdc50
2 changed files with 20 additions and 26 deletions
+18 -23
View File
@@ -71,32 +71,27 @@ jobs:
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
run: | run: |
# 删除已存在的 release 和 tag # 确保 tag 指向当前 commit
gh release delete gost-latest --yes 2>/dev/null || echo "No existing release to delete" git tag -f gost-latest ${{ github.sha }}
git push origin gost-latest --force
# 创建新的 release # 检查 release 是否存在,不存在则创建
gh release create gost-latest \ if gh release view gost-latest 2>/dev/null; then
--title "GOST Binary Latest" \ echo "Release exists, will update assets"
--notes "GOST binary compiled from commit ${{ github.sha }} else
echo "Release not found, creating new release"
gh release create gost-latest gost-latest \
--title "GOST Binary Latest" \
--notes "GOST binary compiled from commit ${{ github.sha }}
- Platform: Linux AMD64
- Compressed with UPX
- Build date: ${{ github.event.head_commit.timestamp }}" \
--repo ${{ github.repository }}
fi
- Platform: Linux AMD64 # 上传 asset 并覆盖同名文件
- Compressed with UPX gh release upload gost-latest ./go-gost/gost --clobber
- Build date: ${{ github.event.head_commit.timestamp }}" \
--repo ${{ github.repository }}
- name: Upload GOST binary to Release
if: steps.gost-changes.outputs.gost == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
# 删除已存在的 asset(如果有)
gh api repos/${{ github.repository }}/releases/tags/gost-latest/assets --jq '.[] | select(.name=="gost") | .id' | xargs -I {} gh api repos/${{ github.repository }}/releases/assets/{} -X DELETE 2>/dev/null || echo "No existing asset to delete"
# 上传新的 asset
gh api repos/${{ github.repository }}/releases/tags/gost-latest/assets \
-F name=gost \
-F "data=@./go-gost/gost" \
-H "Content-Type: application/octet-stream"
build-vite: build-vite:
if: contains(github.event.head_commit.message, '[skip vite]') == false if: contains(github.event.head_commit.message, '[skip vite]') == false
-1
View File
@@ -147,5 +147,4 @@ func main() {
} }
// GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o gost // GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o gost
//
// upx --best --lzma gost // upx --best --lzma gost