-
Notifications
You must be signed in to change notification settings - Fork 51
93 lines (85 loc) · 3.04 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
outputs:
deployment: ${{ steps.deploy.outputs.exit_code }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 5
persist-credentials: false
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Import GPG keys
run: |
gpg --import --batch <(echo "$GPG_PRIVATE_KEY") &> /dev/null
# Gradle doesn't support GPG 2.1 and later: https://github.com/gradle/gradle/issues/888
gpg --export-secret-keys --pinentry-mode loopback --passphrase="$GPG_PASSPHRASE" > ~/.gnupg/secring.gpg
rm -rf /tmp/secret
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Deploy to Sonatype Nexus
id: deploy
run: |
./gradlew publish closeAndReleaseRepository --info -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Psigning.keyId=$GPG_KEYNAME -Psigning.password=$GPG_PASSPHRASE -Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg
echo ::set-output name=exit_code::$?
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
commit-development-version:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 5
persist-credentials: false
- name: Commit next development version
if: needs.release.outputs.deployment == 0
run: |
git config user.email "[email protected]"
git config user.name "Gluon Bot"
TAG=${GITHUB_REF/refs\/tags\//}
newVersion=${TAG%.*}.$((${TAG##*.} + 1)) # Update version by 1
sed -i -z "0,/version = $TAG/s//version = $newVersion-SNAPSHOT/" gradle.properties
git commit gradle.properties -m "Prepare development of $newVersion"
git push https://gluon-bot:[email protected]/$GITHUB_REPOSITORY HEAD:master
env:
PAT: ${{ secrets.GITHUB_TOKEN }}
release-notes:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
release-gluonfx-plugins:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 5
persist-credentials: false
- run: |
TAG=${GITHUB_REF/refs\/tags\//}
bash $GITHUB_WORKSPACE/.github/scripts/release-plugins.sh $TAG $PAT
env:
PAT: ${{ secrets.PAT }}