Skip to content

Commit

Permalink
更改构建的目标平台
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhongjia committed Sep 30, 2023
1 parent 4f15fb7 commit eb27e69
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,18 @@ jobs:
cd ..
cp -r src/admin/dist/ dist/admin
- uses: wangyoucao577/[email protected]
- name: build
uses: actions/setup-go@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: 1.21 # 可以指定编译使用的 Golang 版本
binary_name: "movie" # 可以指定二进制文件的名称
extra_files: README.md config.ini # 需要包含的额外文件
go-version: 'stable'
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o movie-${{ github.ref }}
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o movie-${{ github.ref }}.exe
- name: Upload assets
uses: softprops/action-gh-release@v1
with:
files:
movie-${{ github.ref }}
movie-${{ github.ref }}.exe
prerelease: false

0 comments on commit eb27e69

Please sign in to comment.