添加singbox测试版actions文件
This commit is contained in:
78
.github/workflows/update_singbox_core_test.yaml
vendored
78
.github/workflows/update_singbox_core_test.yaml
vendored
@@ -12,10 +12,59 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
tag3:
|
tag3:
|
||||||
description: 'a new prerelease name or not,such as _PuerNya'
|
description: 'a new prerelease name or not'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
tag4:
|
||||||
|
description: 'build tags'
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
jobs:
|
jobs:
|
||||||
|
go:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{steps.go.outputs.version}}
|
||||||
|
steps:
|
||||||
|
- name: get latest go version
|
||||||
|
id: go
|
||||||
|
run: |
|
||||||
|
echo version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
sing-box:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: go
|
||||||
|
env:
|
||||||
|
REPO: ${{ github.event.inputs.tag1 }}
|
||||||
|
TAGS: ${{ github.event.inputs.tag4 }}
|
||||||
|
outputs:
|
||||||
|
version: ${{steps.sing-box.outputs.version}}
|
||||||
|
tags: ${{steps.sing-box.outputs.tags}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.1.1
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: setup go
|
||||||
|
uses: actions/setup-go@v4.1.0
|
||||||
|
with:
|
||||||
|
go-version: ${{needs.go.outputs.version}}
|
||||||
|
|
||||||
|
- name: get sing-box version
|
||||||
|
id: sing-box
|
||||||
|
run: |
|
||||||
|
git remote add sekai https://github.com/SagerNet/sing-box.git
|
||||||
|
git fetch --tags sekai
|
||||||
|
version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag)
|
||||||
|
echo version=$version >> $GITHUB_OUTPUT
|
||||||
|
if [ -z "$TAGS" ];then
|
||||||
|
if [ "$REPO" = 'SagerNet/sing-box' ];then
|
||||||
|
echo tags=with_quic,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_clash_api >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo tags=with_quic,with_ech,with_utls,with_reality_server,with_clash_api >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo tags=$TAGS >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
cross:
|
cross:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -54,6 +103,7 @@ jobs:
|
|||||||
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: sing-box
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
GOARCH: ${{ matrix.goarch }}
|
GOARCH: ${{ matrix.goarch }}
|
||||||
@@ -61,7 +111,8 @@ jobs:
|
|||||||
GOARM: ${{ matrix.goarm }}
|
GOARM: ${{ matrix.goarm }}
|
||||||
GOMIPS: ${{ matrix.gomips }}
|
GOMIPS: ${{ matrix.gomips }}
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
TAGS: with_quic,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
|
TAGS: ${{needs.sing-box.outputs.tags}}
|
||||||
|
VERSION: ${{needs.sing-box.outputs.version}}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sing-box
|
- name: Checkout sing-box
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||||
@@ -69,22 +120,22 @@ jobs:
|
|||||||
repository: ${{ github.event.inputs.tag1 }}
|
repository: ${{ github.event.inputs.tag1 }}
|
||||||
ref: ${{ github.event.inputs.tag2 }}
|
ref: ${{ github.event.inputs.tag2 }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Get latest go version
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
echo go_version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ steps.version.outputs.go_version }}
|
go-version: ${{ steps.go.outputs.version }}
|
||||||
- name: Build
|
|
||||||
|
- name: build core
|
||||||
id: build
|
id: build
|
||||||
run: make
|
run: go build -v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" ./cmd/sing-box
|
||||||
|
|
||||||
- name: Upload file to workspace
|
- name: Upload file to workspace
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
path: sing-box
|
path: sing-box
|
||||||
|
|
||||||
push_prerelease:
|
push_prerelease:
|
||||||
needs: cross
|
needs: cross
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -95,10 +146,12 @@ jobs:
|
|||||||
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
|
||||||
tar xf upx-3.96-amd64_linux.tar.xz
|
tar xf upx-3.96-amd64_linux.tar.xz
|
||||||
tar xf upx-3.93-amd64_linux.tar.xz
|
tar xf upx-3.93-amd64_linux.tar.xz
|
||||||
|
|
||||||
- name: Download file from workspace
|
- name: Download file from workspace
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ./tmp
|
path: ./tmp
|
||||||
|
|
||||||
- name: Zip core by upx
|
- name: Zip core by upx
|
||||||
run: |
|
run: |
|
||||||
archs=(amd64 armv5 armv7 arm64 mips-softfloat mipsel-hardfloat mipsel-softfloat)
|
archs=(amd64 armv5 armv7 arm64 mips-softfloat mipsel-hardfloat mipsel-softfloat)
|
||||||
@@ -116,19 +169,18 @@ jobs:
|
|||||||
done
|
done
|
||||||
rm -fr upx*
|
rm -fr upx*
|
||||||
rm -fr ./tmp/core.tar.gz
|
rm -fr ./tmp/core.tar.gz
|
||||||
version=$(./bin/singbox/singbox-linux-amd64 version 2>/dev/null | grep version | awk '{print $3}')
|
|
||||||
echo $version > ./tmp/version
|
|
||||||
echo "version=${version}" >> ${GITHUB_ENV}
|
|
||||||
- name: Create Release and Upload Release Asset
|
- name: Create Release and Upload Release Asset
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
tag_name: singbox_core${{ github.event.inputs.tag3 }}
|
tag_name: singbox_core${{ github.event.inputs.tag3 }}
|
||||||
name: singbox_core${{ github.event.inputs.tag3 }}
|
name: singbox_core${{ github.event.inputs.tag3 }}
|
||||||
body: "The ${version} version of ${{ github.event.inputs.tag1 }} \n这是${{ github.event.inputs.tag1 }}的${version}版本内核文件\nhttps://github.com/${{ github.event.inputs.tag1 }}/releases \nZip by upx\n使用了upx进行压缩\nOnly support for ShellCrash\n仅限于ShellCrash项目使用"
|
body: "The ${{steps.sing-box.outputs.version}} version of ${{ github.event.inputs.tag1 }} \n这是${{ github.event.inputs.tag1 }}的${{steps.sing-box.outputs.version}}版本内核文件\nhttps://github.com/${{ github.event.inputs.tag1 }}/releases \nZip by upx\n使用了upx进行压缩\nOnly support for ShellCrash\n仅限于ShellCrash项目使用"
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |
|
files: |
|
||||||
./tmp/*
|
./tmp/*
|
||||||
|
|
||||||
- name: Cleanup Workflow
|
- name: Cleanup Workflow
|
||||||
uses: Mattraks/delete-workflow-runs@main
|
uses: Mattraks/delete-workflow-runs@main
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user