examples: try fix wowjump 7 .#20 #86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Check | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| env: | |
| CGO_ENABLED: 0 | |
| GOOS: windows | |
| GOARCH: amd64 | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - name: Set up Go 1.21.5 | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '>=1.23' | |
| id: go | |
| - name: mod tidy | |
| run: go mod tidy -v | |
| - name: check basic | |
| run: cd examples/basic;windres -i ui/ui.rc -O coff -o ui.syso | |
| - name: build basic | |
| run: cd examples/basic;go generate -v;go build -ldflags="-s -w -H windowsgui" -v | |
| - name: check simple | |
| run: | |
| cd examples/simple; | |
| windres -i emptyProject/Debug/resource.res -O coff -o vsui.syso; | |
| go build -ldflags="-s -w -H windowsgui" | |
| - name: Install go-winres | |
| run: go install github.com/tc-hib/go-winres@latest | |
| # 取消 winres调用。 生成的资源文件会变成乱码,暂时不知道如果解决。 发布 wowjump release之前需要手动生成 ui.syso. | |
| # windres -i ui/ui.rc -O coff -o ui.syso; | |
| - name: check wowjump | |
| run: | |
| cd examples/wowjump; | |
| go-winres make --in ui/ui.rc --out ui.syso --arch amd64; | |
| go generate; | |
| go build -ldflags="-s -w -H windowsgui" | |
| - name: Pre-release | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'whtiehack/wingui' | |
| run: | | |
| mkdir release | |
| Compress-Archive -CompressionLevel Optimal -Force -Path examples/basic/basic.exe,examples/basic/bitmap.jpg -DestinationPath release/basic.zip | |
| Compress-Archive -CompressionLevel Optimal -Force -Path examples/simple/simple.exe -DestinationPath release/simple.zip | |
| Compress-Archive -CompressionLevel Optimal -Force -Path examples/wowjump/wowjump.exe -DestinationPath release/wowjump.zip | |
| - name: Draft Release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') && github.repository == 'whtiehack/wingui' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: | | |
| release/basic.zip | |
| release/simple.zip | |
| release/wowjump.zip | |
| draft: true |