支持window

This commit is contained in:
root
2025-12-06 04:34:47 +00:00
parent 1533e08425
commit 15b4176afb
6 changed files with 268 additions and 10 deletions

View File

@@ -47,6 +47,10 @@ jobs:
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
- goos: windows
goarch: arm64
steps:
- name: Checkout code
@@ -58,6 +62,7 @@ jobs:
go-version: '1.21'
- name: Build binary
id: build
working-directory: codex-wrapper
env:
GOOS: ${{ matrix.goos }}
@@ -66,14 +71,18 @@ jobs:
run: |
VERSION=${GITHUB_REF#refs/tags/}
OUTPUT_NAME=codex-wrapper-${{ matrix.goos }}-${{ matrix.goarch }}
if [ "${{ matrix.goos }}" = "windows" ]; then
OUTPUT_NAME="${OUTPUT_NAME}.exe"
fi
go build -ldflags="-s -w -X main.version=${VERSION}" -o ${OUTPUT_NAME} .
chmod +x ${OUTPUT_NAME}
echo "artifact_path=codex-wrapper/${OUTPUT_NAME}" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: codex-wrapper-${{ matrix.goos }}-${{ matrix.goarch }}
path: codex-wrapper/codex-wrapper-${{ matrix.goos }}-${{ matrix.goarch }}
path: ${{ steps.build.outputs.artifact_path }}
release:
name: Create Release
@@ -92,7 +101,7 @@ jobs:
run: |
mkdir -p release
find artifacts -type f -name "codex-wrapper-*" -exec mv {} release/ \;
cp install.sh release/
cp install.sh install.ps1 install.bat release/
ls -la release/
- name: Create Release