Skip to content

Commit

Permalink
更改获取版本号的方式
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinWin committed Jan 1, 2025
1 parent e4e34b8 commit 553319b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 64 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/update-adguardhome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Get `Go` latest version
id: go
run: |
echo version=$(curl -sSL https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep '"version"' | head -1 | awk -F'"' '{print $4}') >> $GITHUB_OUTPUT
echo version=$(curl -sSL https://api.github.com/repos/actions/go-versions/releases/latest | jq -r '.tag_name | split("-")[0]') >> $GITHUB_OUTPUT
node:
runs-on: ubuntu-latest
Expand All @@ -36,7 +36,6 @@ jobs:
release:
runs-on: ubuntu-latest
needs: go
outputs:
release_version: ${{ steps.release.outputs.release_version }}
release_time: ${{ steps.release.outputs.release_time }}
Expand All @@ -48,15 +47,10 @@ jobs:
ref: beta-v0.107
fetch-depth: 0

- name: Setup `Go`
uses: actions/setup-go@v5
with:
go-version: ${{ needs.go.outputs.version }}

- name: Get `AdGuard Home Release` version and time
id: release
run: |
release_version=$(git describe --tags --abbrev=0 HEAD)
release_version=$(curl -sSL https://api.github.com/repos/AdguardTeam/AdGuardHome/releases/latest | jq -r '.tag_name')
echo "release_version=$release_version" >> $GITHUB_OUTPUT
release_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' ${release_version})
echo "release_time=$release_time" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -125,7 +119,6 @@ jobs:

beta:
runs-on: ubuntu-latest
needs: go
outputs:
beta_version: ${{ steps.beta.outputs.beta_version }}
beta_time: ${{ steps.beta.outputs.beta_time }}
Expand All @@ -137,15 +130,10 @@ jobs:
ref: beta-v0.108
fetch-depth: 0

- name: Setup `Go`
uses: actions/setup-go@v5
with:
go-version: ${{ needs.go.outputs.version }}

- name: Get `AdGuard Home Beta` version and time
id: beta
run: |
beta_version=$(git describe --tags --abbrev=0 HEAD)
beta_version=$(curl -sSL https://api.github.com/repos/AdguardTeam/AdGuardHome/releases | jq -r '[.[] | select(.tag_name | test("b"))][0].tag_name')
echo "beta_version=$beta_version" >> $GITHUB_OUTPUT
beta_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' ${beta_version})
echo "beta_time=$beta_time" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Download and compress `yacd` dashboard
run: |
mkdir -p ./tmp/yacd/
mkdir -p ./Dashboard/ ./tmp/yacd/
curl -o ./tmp/yacd/gh-pages.zip -L https://github.com/haishanh/yacd/archive/refs/heads/gh-pages.zip
unzip -o ./tmp/yacd/gh-pages.zip -d ./tmp/yacd/
tar -czf ./Dashboard/yacd.tar.gz -C ./tmp/yacd/yacd-gh-pages/ .
Expand Down
26 changes: 7 additions & 19 deletions .github/workflows/update-mihomo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ jobs:
- name: Get `Go` latest version
id: go
run: |
echo version=$(curl -sSL https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep '"version"' | head -1 | awk -F'"' '{print $4}') >> $GITHUB_OUTPUT
echo version=$(curl -sSL https://api.github.com/repos/actions/go-versions/releases/latest | jq -r '.tag_name | split("-")[0]') >> $GITHUB_OUTPUT
meta:
runs-on: ubuntu-latest
needs: go
outputs:
meta_version: ${{ steps.meta.outputs.meta_version }}
meta_tags: ${{ steps.meta.outputs.meta_tags }}
Expand All @@ -39,15 +38,10 @@ jobs:
ref: Meta
fetch-depth: 0

- name: Setup `Go`
uses: actions/setup-go@v5
with:
go-version: ${{ needs.go.outputs.version }}

- name: Get `mihomo Meta` version
- name: Get `mihomo Meta` version and time
id: meta
run: |
meta_version=$(git describe --tags --abbrev=0 HEAD)
meta_version=$(curl -sSL https://api.github.com/repos/MetaCubeX/mihomo/releases/latest | jq -r '.tag_name')
echo "meta_version=$meta_version" >> $GITHUB_OUTPUT
echo meta_tags=with_gvisor >> $GITHUB_OUTPUT
meta_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' ${meta_version})
Expand Down Expand Up @@ -117,9 +111,8 @@ jobs:

alpha:
runs-on: ubuntu-latest
needs: go
outputs:
alpha_version: ${{ steps.alpha.outputs.alpha_version }}
alpha_version: alpha-${{ steps.alpha.outputs.alpha_version }}
alpha_tags: ${{ steps.alpha.outputs.alpha_tags }}
alpha_time: ${{ steps.alpha.outputs.alpha_time }}
steps:
Expand All @@ -130,18 +123,13 @@ jobs:
ref: Alpha
fetch-depth: 0

- name: Setup `Go`
uses: actions/setup-go@v5
with:
go-version: ${{ needs.go.outputs.version }}

- name: Get `mihomo Alpha` version
- name: Get `mihomo Alpha` version and time
id: alpha
run: |
alpha_version=alpha-$(git rev-parse --short HEAD)
alpha_version=$(curl -sSL https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt | sed 's/.*-//')
echo "alpha_version=$alpha_version" >> $GITHUB_OUTPUT
echo alpha_tags=with_gvisor >> $GITHUB_OUTPUT
alpha_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' $(git rev-parse --short HEAD))
alpha_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' ${alpha_version})
echo "alpha_time=$alpha_time" >> $GITHUB_OUTPUT
alpha_cross:
Expand Down
34 changes: 9 additions & 25 deletions .github/workflows/update-singbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Get `Go` latest version
id: go
run: |
echo version=$(curl -sSL https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep '"version"' | head -1 | awk -F'"' '{print $4}') >> $GITHUB_OUTPUT
echo version=$(curl -sSL https://api.github.com/repos/actions/go-versions/releases/latest | jq -r '.tag_name | split("-")[0]') >> $GITHUB_OUTPUT
puernya:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -125,7 +125,6 @@ jobs:

release:
runs-on: ubuntu-latest
needs: go
outputs:
release_version: ${{ steps.release.outputs.release_version }}
release_tags: ${{ steps.release.outputs.release_tags }}
Expand All @@ -138,20 +137,13 @@ jobs:
ref: main
fetch-depth: 0

- name: Setup `Go`
uses: actions/setup-go@v5
with:
go-version: ${{ needs.go.outputs.version }}

- name: Get `sing-box Release` version
- name: Get `sing-box Release` version and time
id: release
run: |
git remote add sekai https://github.com/SagerNet/sing-box.git
git fetch --tags sekai
release_version=$(curl -sSL https://api.github.com/repos/SagerNet/sing-box/releases/latest | grep '"tag_name"' | head -n 1 | awk -F'"' '{print $4}' | sed 's/^v//')
release_version=$(curl -sSL https://api.github.com/repos/SagerNet/sing-box/releases/latest | jq -r '.tag_name')
echo "release_version=$release_version" >> $GITHUB_OUTPUT
echo release_tags=with_gvisor,with_dhcp,with_wireguard,with_clash_api,with_quic,with_utls,with_ech >> $GITHUB_OUTPUT
release_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' v${release_version})
release_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' ${release_version})
echo "release_time=$release_time" >> $GITHUB_OUTPUT
release_cross:
Expand Down Expand Up @@ -221,7 +213,6 @@ jobs:

dev:
runs-on: ubuntu-latest
needs: go
outputs:
dev_version: ${{ steps.dev.outputs.dev_version }}
dev_tags: ${{ steps.dev.outputs.dev_tags }}
Expand All @@ -234,20 +225,13 @@ jobs:
ref: dev
fetch-depth: 0

- name: Setup `Go`
uses: actions/setup-go@v5
with:
go-version: ${{ needs.go.outputs.version }}

- name: Get `sing-box Dev` version
- name: Get `sing-box Dev` version and time
id: dev
run: |
git remote add sekai https://github.com/SagerNet/sing-box.git
git fetch --tags sekai
dev_version=$(curl -sSL https://api.github.com/repos/SagerNet/sing-box/releases | grep '"tag_name"' | grep -E 'beta|alpha' | head -n 1 | awk -F'"' '{print $4}' | sed 's/^v//')
dev_version=$(curl -sSL https://api.github.com/repos/SagerNet/sing-box/releases | jq -r '[.[] | select(.tag_name | test("alpha|beta"))][0].tag_name')
echo "dev_version=$dev_version" >> $GITHUB_OUTPUT
echo dev_tags=with_gvisor,with_dhcp,with_wireguard,with_clash_api,with_quic,with_utls,with_ech >> $GITHUB_OUTPUT
dev_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' v${dev_version})
dev_time=$(git log -1 --format=%cd --date=format:'%Y-%m-%d' ${dev_version})
echo "dev_time=$dev_time" >> $GITHUB_OUTPUT
dev_cross:
Expand Down Expand Up @@ -395,8 +379,8 @@ jobs:
overwrite: true
body: |
更新 [sing-box PuerNya 版](https://github.com/PuerNya/sing-box/tree/building)至 v${{ env.puernya_VERSION }},发布于 ${{ env.puernya_TIME }}
更新 [sing-box Release 版](https://github.com/SagerNet/sing-box/tree/main)至 v${{ env.release_VERSION }},发布于 ${{ env.release_TIME }}
更新 [sing-box Dev 版](https://github.com/SagerNet/sing-box/tree/dev)至 v${{ env.dev_VERSION }},发布于 ${{ env.dev_TIME }}
更新 [sing-box Release 版](https://github.com/SagerNet/sing-box/tree/main)至 ${{ env.release_VERSION }},发布于 ${{ env.release_TIME }}
更新 [sing-box Dev 版](https://github.com/SagerNet/sing-box/tree/dev)至 ${{ env.dev_VERSION }},发布于 ${{ env.dev_TIME }}
file_glob: true
file: ./sing-box/*

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
每天凌晨(北京时间 UTC+8)自动构建生成:
1. [Clash Premium Release 版和 Nightly 版内核](https://github.com/DustinWin/proxy-tools/releases/tag/Clash-Premium)(已停更)
2. mihomo Meta 版和 Alpha 版内核
3. sing-box Release 版和 Dev 版内核
4. sing-box PuerNya 版内核(支持 `outbound_providers` 代理集合)
5. Dashboard 面板:[yacd 面板](https://github.com/haishanh/yacd)[Yacd-meta 面板](https://github.com/MetaCubeX/Yacd-meta)[metacubexd 面板](https://github.com/MetaCubeX/metacubexd)[zashboard 面板](https://github.com/Zephyruso/zashboard)
6. AdGuard Home Release 版和 Beta 版
3. sing-box Release 版、Dev 版内核和 sing-box PuerNya 版内核(支持 `outbound_providers` 代理集合)
4. Dashboard 面板:[yacd 面板](https://github.com/haishanh/yacd)[Yacd-meta 面板](https://github.com/MetaCubeX/Yacd-meta)[metacubexd 面板](https://github.com/MetaCubeX/metacubexd)[zashboard 面板](https://github.com/Zephyruso/zashboard)
5. AdGuard Home Release 版和 Beta 版

**注:**
- 1. 本教程中的下载链接以 CPU 架构 ARMv8 为例,请注意修改链接后缀
Expand Down

0 comments on commit 553319b

Please sign in to comment.