已修改 .github/workflows/update_meta_core.yaml
This commit is contained in:
34
.github/workflows/update_meta_core.yaml
vendored
34
.github/workflows/update_meta_core.yaml
vendored
@@ -45,11 +45,6 @@ jobs:
|
|||||||
version: ${{steps.meta.outputs.version}}
|
version: ${{steps.meta.outputs.version}}
|
||||||
tags: ${{steps.meta.outputs.tags}}
|
tags: ${{steps.meta.outputs.tags}}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: setup go
|
|
||||||
uses: actions/setup-go@v4.1.0
|
|
||||||
with:
|
|
||||||
go-version: ${{needs.go.outputs.version}}
|
|
||||||
|
|
||||||
- name: get meta version
|
- name: get meta version
|
||||||
id: meta
|
id: meta
|
||||||
@@ -60,7 +55,7 @@ jobs:
|
|||||||
echo tags='' >> $GITHUB_OUTPUT
|
echo tags='' >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo tags=$TAGS >> $GITHUB_OUTPUT
|
echo tags=$TAGS >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cross:
|
cross:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -114,22 +109,32 @@ jobs:
|
|||||||
VERSION: ${{needs.meta.outputs.version}}
|
VERSION: ${{needs.meta.outputs.version}}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout meta
|
- name: Checkout meta
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.event.inputs.tag1 }}
|
repository: ${{ github.event.inputs.tag1 }}
|
||||||
ref: ${{ github.event.inputs.tag2 }}
|
ref: ${{ github.event.inputs.tag2 }}
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: ${{needs.go.outputs.version}}
|
go-version: ${{needs.go.outputs.version}}
|
||||||
|
|
||||||
- name: Set ENV
|
- name: Set variables
|
||||||
run: |
|
run: |
|
||||||
sudo timedatectl set-timezone "Asia/Shanghai"
|
VERSION="${GITHUB_REF_NAME,,}-$(git rev-parse --short HEAD)"
|
||||||
echo "BUILDTIME=$(date)" >> $GITHUB_ENV
|
VERSION="${VERSION//\//-}"
|
||||||
shell: bash
|
PackageVersion="$(curl -s "https://api.github.com/repos/MetaCubeX/mihomo/releases/latest" | jq -r '.tag_name' | sed 's/v//g' | awk -F '.' '{$NF = $NF + 1; print}' OFS='.').${VERSION/-/.}"
|
||||||
|
if [ -n "${{ github.event.inputs.version }}" ]; then
|
||||||
|
VERSION=${{ github.event.inputs.version }}
|
||||||
|
PackageVersion="${VERSION#v}"
|
||||||
|
fi
|
||||||
|
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||||
|
echo "PackageVersion=${PackageVersion}" >> $GITHUB_ENV
|
||||||
|
echo "BUILDTIME=$(date)" >> $GITHUB_ENV
|
||||||
|
echo "CGO_ENABLED=0" >> $GITHUB_ENV
|
||||||
|
echo "BUILDTAG=-extldflags --static" >> $GITHUB_ENV
|
||||||
|
echo "GOTOOLCHAIN=local" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Update CA
|
- name: Update CA
|
||||||
run: |
|
run: |
|
||||||
@@ -139,8 +144,9 @@ jobs:
|
|||||||
|
|
||||||
- name: build core
|
- name: build core
|
||||||
id: build
|
id: build
|
||||||
run: go build -v -trimpath -ldflags "-X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -X 'github.com/metacubex/mihomo/constant.BuildTime=${BUILDTIME}' -s -w -buildid=" -tags "${TAGS}" -o meta
|
run: |
|
||||||
|
go env
|
||||||
|
go build -v -tags "${TAGS}" -o meta -trimpath -ldflags "${BUILDTAG} -X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -X 'github.com/metacubex/mihomo/constant.BuildTime=${BUILDTIME}' -w -s -buildid="
|
||||||
- name: Upload file to workspace
|
- name: Upload file to workspace
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user