This commit is contained in:
juewuy
2024-03-30 12:39:48 +08:00
parent e7a5c48cce
commit cd67f55125
2 changed files with 25 additions and 8 deletions

View File

@@ -2,14 +2,33 @@ name: core_auto_update
on: on:
schedule: schedule:
- cron: 0 18 * * 6 - cron: 0 18 * * *
workflow_dispatch: workflow_dispatch:
jobs: jobs:
check_version:
runs-on: ubuntu-latest
steps:
- name: Get old version
run: |
echo version_old=$(curl -sSl https://github.com/juewuy/ShellCrash/releases/download/singbox_core_PuerNya/version) >> $GITHUB_OUTPUT
- name: checkout
- uses: actions/checkout@v4
with:
repository: PuerNya/sing-box
ref: building
fetch-depth: 0
- name: Get new version
run: |
git remote add sekai https://github.com/SagerNet/sing-box.git
git fetch --tags sekai
echo version_new=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag) >> $GITHUB_OUTPUT
auto_update_singboxp_with_wg: auto_update_singboxp_with_wg:
permissions: needs: check_version
id-token: write # need this for OIDC if: ${{ needs.check_version.outputs.version_new != needs.check_version.outputs.version_old }}
contents: write permissions: write-all
uses: juewuy/ShellCrash/.github/workflows/update_singbox_core.yaml@dev uses: juewuy/ShellCrash/.github/workflows/update_singbox_core.yaml@dev
with: with:
tag1: PuerNya/sing-box tag1: PuerNya/sing-box

View File

@@ -162,10 +162,6 @@ jobs:
path: sing path: sing
repository: PuerNya/sing repository: PuerNya/sing
- name: replace sing
if: ${{ env.REPO == 'PuerNya/sing-box' }}
run: sed -i 's/^\/\/replace github.com.*$/replace github.com\/sagernet\/sing => .\/sing/' go.mod
- name: build core - name: build core
id: build id: build
run: go build -v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" ./cmd/sing-box run: go build -v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" ./cmd/sing-box
@@ -206,6 +202,7 @@ jobs:
done done
mv -f ./tmp/singbox-linux-mipsel-hardfloat.tar.gz ./tmp/singbox-linux-mipsle-hardfloat.tar.gz mv -f ./tmp/singbox-linux-mipsel-hardfloat.tar.gz ./tmp/singbox-linux-mipsle-hardfloat.tar.gz
mv -f ./tmp/singbox-linux-mipsel-softfloat.tar.gz ./tmp/singbox-linux-mipsle-softfloat.tar.gz mv -f ./tmp/singbox-linux-mipsel-softfloat.tar.gz ./tmp/singbox-linux-mipsle-softfloat.tar.gz
echo ${VERSION} > ./tmp/version
- name: Commit and push - name: Commit and push
if: ${{ env.PUSHDIR != '' }} if: ${{ env.PUSHDIR != '' }}
@@ -232,6 +229,7 @@ jobs:
prerelease: true prerelease: true
files: | files: |
./tmp/singbox*.tar.gz ./tmp/singbox*.tar.gz
./tmp/version
- name: Cleanup Workflow - name: Cleanup Workflow
uses: Mattraks/delete-workflow-runs@main uses: Mattraks/delete-workflow-runs@main