chore(version): 更新应用版本号至v1.4.0 #33
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 and Release Multi-Platform Packages | |
| on: | |
| push: | |
| branches: [ "main", "master" ] | |
| tags: [ "v*" ] | |
| pull_request: | |
| branches: [ "main", "master" ] | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build with Maven | |
| run: mvn -B package | |
| - name: Package artifacts (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| cd target | |
| 7z a -tzip nbcommand-windows.zip nbcommand/ | |
| - name: Package artifacts (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| cd target | |
| zip -r nbcommand-linux.zip nbcommand/ | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nbcommand-${{ matrix.os }} | |
| path: target/nbcommand-*.zip | |
| if-no-files-found: error | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| artifacts/nbcommand-windows-latest/nbcommand-windows.zip | |
| artifacts/nbcommand-ubuntu-latest/nbcommand-linux.zip | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |