-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 2.09 KB
/
release.yml
File metadata and controls
69 lines (57 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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 }}