Merge pull request #2 from dotCMS/fix/ga4-compatibility #1
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| - '.gitignore' | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'microsoft' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew clean jar | |
| - name: Get version from build.gradle | |
| id: get_version | |
| run: | | |
| VERSION=$(grep "^version = " build.gradle | cut -d "'" -f 2) | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building version $VERSION" | |
| - name: Check if release exists | |
| id: check_release | |
| run: | | |
| RELEASE_EXISTS=$(gh release view "v${{ steps.get_version.outputs.VERSION }}" > /dev/null 2>&1 && echo "true" || echo "false") | |
| echo "EXISTS=$RELEASE_EXISTS" >> $GITHUB_OUTPUT | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| if: steps.check_release.outputs.EXISTS == 'false' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ steps.get_version.outputs.VERSION }} | |
| name: Release ${{ steps.get_version.outputs.VERSION }} | |
| body: | | |
| ## Google Analytics Plugin v${{ steps.get_version.outputs.VERSION }} | |
| ### Installation | |
| 1. Download `google-analytics-${{ steps.get_version.outputs.VERSION }}.jar` | |
| 2. Upload to dotCMS via System → Dynamic Plugins | |
| 3. Configure via System → Apps → Google Analytics | |
| ### What's Changed | |
| See commit history for details. | |
| **Full Changelog**: https://github.com/${{ github.repository }}/commits/v${{ steps.get_version.outputs.VERSION }} | |
| files: | | |
| build/libs/google-analytics-*.jar | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |