更新 GitHub 发布步骤,使用 softprops/action-gh-release@v2 进行发布 #3
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 Windows Runtime | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: # 可选:被主流程调用 | |
| jobs: | |
| win-runtime: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Build Windows runtime image | |
| shell: pwsh | |
| run: | | |
| $env:RELEASE_TOKEN="${{ secrets.RELEASE_TOKEN }}" | |
| ./gradlew runtime # 只生成 win 镜像 | |
| - name: 7z Compact | |
| run: | | |
| cd build/image | |
| 7z a -mx=9 javaows-linux.zip javaows-linux/* | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ github.run_number }} | |
| name: v${{ github.run_number }} | |
| files: build/image/javaows-win.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} |