-
Notifications
You must be signed in to change notification settings - Fork 62
62 lines (56 loc) · 2.25 KB
/
release.yml
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
name: Release
on:
push:
tags:
- '*'
jobs:
build:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Build and verify project
run: |
export DISPLAY=:90
Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 &
./gradlew clean build -i
- name: Publish to Gradle plugin repository
id: deploy
run: |
./gradlew publishPlugins -Pgradle.publish.key=$PUBLISH_KEY -Pgradle.publish.secret=$PUBLISH_SECRET
shell: bash
env:
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
PUBLISH_SECRET: ${{ secrets.PUBLISH_SECRET }}
- name: Commit next development version
if: steps.deploy.outputs.exit_code == 0
run: |
git config user.email "[email protected]"
git config user.name "Gluon Bot"
TAG=${GITHUB_REF/refs\/tags\//}
# Update README with the latest released version
sed -i "0,/id 'org.openjfx.javafxplugin' version '.*'/s//id 'org.openjfx.javafxplugin' version '$TAG'/" README.md
sed -i "0,/id(\"org.openjfx.javafxplugin\") version \".*\"/s//id(\"org.openjfx.javafxplugin\") version \"$TAG\"/" README.md
sed -i "0,/'org.openjfx:javafx-plugin:.*'/s//'org.openjfx:javafx-plugin:$TAG'/" README.md
sed -i "0,/\"org.openjfx:javafx-plugin:.*\"/s//\"org.openjfx:javafx-plugin:$TAG\"/" README.md
git commit README.md -m "Use latest release v$TAG in README"
# Update project version
newVersion=${TAG%.*}.$((${TAG##*.} + 1))
echo "Update project version to next snapshot version"
sed -i "0,/^version = '$TAG'/s//version = '$newVersion-SNAPSHOT'/" build.gradle
git commit build.gradle -m "Prepare development of $newVersion"
git push https://github.com/openjfx/javafx-gradle-plugin HEAD:master
env:
PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true