fix: split release create and asset uploads into separate steps for r… #14
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['[0-9]*.[0-9]*.[0-9]*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Build, unit tests + integration tests | |
| run: mvn -B verify | |
| native: | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| label: linux-amd64 | |
| binary: qtsurfer-mcp | |
| asset: qtsurfer-mcp-linux-amd64 | |
| - os: macos-latest | |
| label: macos-arm64 | |
| binary: qtsurfer-mcp | |
| asset: qtsurfer-mcp-macos-arm64 | |
| - os: windows-latest | |
| label: windows-amd64 | |
| binary: qtsurfer-mcp.exe | |
| asset: qtsurfer-mcp-windows-amd64.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'graalvm' | |
| cache: 'maven' | |
| - name: Build native binary | |
| run: mvn -B -Pnative -DskipTests package native:compile-no-fork | |
| - name: Upload native binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset }} | |
| path: target/${{ matrix.binary }} | |
| retention-days: 1 | |
| release: | |
| needs: [build, native] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Build fat JAR | |
| run: mvn -B package -DskipTests | |
| - name: Download native binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: native-binaries | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| awk "/^## \[${GITHUB_REF_NAME}\]/{found=1; next} found && /^## \[/{exit} found{print}" \ | |
| CHANGELOG.md > /tmp/release-notes.md | |
| gh release create "$GITHUB_REF_NAME" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --notes-file /tmp/release-notes.md | |
| - name: Upload fat JAR | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| JAR=$(ls target/mcp-*.jar | grep -v 'original-' | head -1) | |
| gh release upload "$GITHUB_REF_NAME" "$JAR#qtsurfer-mcp-java-${GITHUB_REF_NAME}.jar" | |
| - name: Upload native binaries | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release upload "$GITHUB_REF_NAME" \ | |
| "native-binaries/qtsurfer-mcp-linux-amd64/qtsurfer-mcp#qtsurfer-mcp-linux-amd64" | |
| gh release upload "$GITHUB_REF_NAME" \ | |
| "native-binaries/qtsurfer-mcp-macos-arm64/qtsurfer-mcp#qtsurfer-mcp-macos-arm64" | |
| gh release upload "$GITHUB_REF_NAME" \ | |
| "native-binaries/qtsurfer-mcp-windows-amd64.exe/qtsurfer-mcp.exe#qtsurfer-mcp-windows-amd64.exe" |