修改生成文件为多个可执行文件
This commit is contained in:
@@ -24,10 +24,33 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout source
|
||||
shell: bash
|
||||
env:
|
||||
CI_SERVER_URL: ${{ gitea.server_url }}
|
||||
CI_REPOSITORY: ${{ gitea.repository }}
|
||||
CI_REF: ${{ gitea.ref }}
|
||||
CI_SHA: ${{ gitea.sha }}
|
||||
CI_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
workspace="${GITHUB_WORKSPACE:-$PWD}"
|
||||
repo_url="${CI_SERVER_URL}/${CI_REPOSITORY}.git"
|
||||
|
||||
rm -rf "$workspace/.git"
|
||||
git init "$workspace"
|
||||
git -C "$workspace" remote add origin "$repo_url"
|
||||
|
||||
if [[ -n "${CI_TOKEN}" ]]; then
|
||||
auth_header="Authorization: token ${CI_TOKEN}"
|
||||
git -C "$workspace" -c http.extraHeader="$auth_header" fetch --depth=1 origin "${CI_REF}"
|
||||
else
|
||||
git -C "$workspace" fetch --depth=1 origin "${CI_REF}"
|
||||
fi
|
||||
|
||||
git -C "$workspace" checkout --detach FETCH_HEAD
|
||||
git -C "$workspace" submodule update --init --recursive --depth=1
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
@@ -83,36 +106,14 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
chmod +x ./building-linux.sh
|
||||
rm -rf dist artifacts
|
||||
mkdir -p dist artifacts
|
||||
rm -rf dist
|
||||
mkdir -p dist
|
||||
|
||||
VERSION="$VERSION" DIST_DIR="$PWD/dist" ./building-linux.sh ${BUILD_TARGETS}
|
||||
|
||||
- name: Package artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
shopt -s nullglob
|
||||
|
||||
for file in dist/*; do
|
||||
name="$(basename "$file")"
|
||||
if [[ "$name" == *.exe ]]; then
|
||||
archive="artifacts/${name%.exe}-${VERSION}.zip"
|
||||
zip -j "$archive" "$file"
|
||||
else
|
||||
archive="artifacts/${name}-${VERSION}.tar.gz"
|
||||
tar -C dist -czf "$archive" "$name"
|
||||
fi
|
||||
done
|
||||
|
||||
(
|
||||
cd artifacts
|
||||
sha256sum * > SHA256SUMS.txt
|
||||
)
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: sing-box-${{ env.VERSION }}
|
||||
path: artifacts
|
||||
path: dist
|
||||
if-no-files-found: error
|
||||
|
||||
Reference in New Issue
Block a user