Repository navigation
Fixed diff panel height and stale card on second diff #162
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: Build | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| JAVA_VERSION: '17' | |
| JAVA_DISTRIBUTION: temurin | |
| jobs: | |
| calc_ver: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| project_ver: ${{ steps.ver.outputs.project_ver }} | |
| release_flag: ${{ steps.ver.outputs.release_flag }} | |
| release_tag: ${{ steps.ver.outputs.release_tag }} | |
| release_upload_url: ${{ steps.ver.outputs.release_upload_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| cache: maven | |
| - name: Auto-tag | |
| if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.repository == 'nbclaudecodegui/NetbeansClaudeCodeGui' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }} | |
| bash build-scripts/autotag.sh | |
| - name: Calculate version | |
| id: ver | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git fetch --prune --tags | |
| # Release tag on current commit? | |
| REL_TAG=$(git tag --points-at HEAD | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' || true) | |
| if [[ -n "$REL_TAG" ]]; then | |
| VER="$REL_TAG" | |
| RELEASE=ON | |
| # Create draft release if not yet exists | |
| if ! gh release view "$REL_TAG" --json id -q .id &>/dev/null; then | |
| NOTES=RELNOTES.md | |
| [[ -f "$NOTES" ]] || echo "Release $VER" > "$NOTES" | |
| gh release create "$REL_TAG" --draft --title "$VER" --notes-file "$NOTES" | |
| fi | |
| UPLOAD_URL=$(gh release view "$REL_TAG" --json uploadUrl -q .uploadUrl) | |
| else | |
| POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-.*//') | |
| MM=$(echo "$POM_VERSION" | cut -d. -f1-2) | |
| MM_ESC="${MM//./\\.}" | |
| LAST_REL=$(git tag | grep -E "^${MM_ESC}\.[0-9]+$" | sort -V | tail -1) | |
| BASE_TAG=$(git tag | grep -E "^${MM_ESC}$" | sort -V | tail -1 || echo "") | |
| if [[ -n "$LAST_REL" ]]; then | |
| START=$(echo "$LAST_REL" | cut -d. -f3) | |
| N=$(git rev-list "${LAST_REL}..HEAD" --count 2>/dev/null || echo "0") | |
| VER="${MM}.$((START + N))" | |
| elif [[ -n "$BASE_TAG" ]]; then | |
| N=$(git rev-list "${BASE_TAG}..HEAD" --count 2>/dev/null || echo "0") | |
| VER="${MM}.${N}" | |
| else | |
| VER="${MM}.0" | |
| fi | |
| RELEASE=OFF | |
| UPLOAD_URL="" | |
| REL_TAG="" | |
| fi | |
| echo "project_ver=$VER" >> $GITHUB_OUTPUT | |
| echo "release_flag=$RELEASE" >> $GITHUB_OUTPUT | |
| echo "release_tag=$REL_TAG" >> $GITHUB_OUTPUT | |
| echo "release_upload_url=$UPLOAD_URL" >> $GITHUB_OUTPUT | |
| echo "Version: $VER (release=$RELEASE)" | |
| build: | |
| needs: calc_ver | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| cache: maven | |
| server-id: central | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_PASSWORD | |
| gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Install pandoc | |
| run: sudo apt-get install -y pandoc | |
| - name: Set version | |
| run: mvn versions:set -DnewVersion=${{ needs.calc_ver.outputs.project_ver }} --batch-mode | |
| - name: Build and test | |
| # xvfb-run provides a virtual display so Swing UI tests don't throw HeadlessException | |
| run: xvfb-run mvn package --batch-mode | |
| - name: Deploy to Maven Central (release only) | |
| if: needs.calc_ver.outputs.release_flag == 'ON' && github.repository == 'nbclaudecodegui/NetbeansClaudeCodeGui' | |
| run: | | |
| VERSION="${{ needs.calc_ver.outputs.project_ver }}" | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ | |
| "https://repo1.maven.org/maven2/io/github/nbclaudecodegui/netbeans-claude-code-gui/$VERSION/netbeans-claude-code-gui-$VERSION.pom") | |
| if [[ "$STATUS" == "200" ]]; then | |
| echo "Version $VERSION already published to Maven Central, skipping." | |
| else | |
| mvn deploy -P release -DskipTests --batch-mode | |
| fi | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
| - name: Build documentation | |
| run: | | |
| VERSION=${{ needs.calc_ver.outputs.project_ver }} | |
| pandoc \ | |
| --metadata title="Claude Code GUI for NetBeans — User Manual" \ | |
| --embed-resources --standalone \ | |
| --resource-path=docs \ | |
| -o "target/netbeans-claude-code-gui-${VERSION}-docs.html" \ | |
| docs/installation.md \ | |
| docs/user-manual.md | |
| - name: Upload artifact and release asset | |
| uses: nanoufo/action-upload-artifacts-and-release-assets@v2 | |
| with: | |
| path: | | |
| target/*.nbm | |
| target/*-docs.html | |
| upload-release-files: ${{ needs.calc_ver.outputs.release_flag == 'ON' }} | |
| release-upload-url: ${{ needs.calc_ver.outputs.release_upload_url }} | |
| release: | |
| needs: [calc_ver, build] | |
| if: needs.calc_ver.outputs.release_flag == 'ON' && github.repository == 'nbclaudecodegui/NetbeansClaudeCodeGui' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Publish GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| REL_TAG="${{ needs.calc_ver.outputs.release_tag }}" | |
| IS_DRAFT=$(gh release view "$REL_TAG" --json isDraft -q .isDraft 2>/dev/null || echo "true") | |
| if [[ "$IS_DRAFT" == "false" ]]; then | |
| echo "GitHub Release already published." | |
| else | |
| gh release edit "$REL_TAG" --draft=false --repo ${{ github.repository }} | |
| fi | |