Skip to content

Commit 5767f21

Browse files
Merge remote-tracking branch 'remotes/origin/feature/github-actions'
2 parents 55533cf + b8ff4f0 commit 5767f21

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish SNAPSHOT
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
artifact:
8+
environment: production
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v3
13+
- name: Get Info
14+
run: |
15+
echo "version=$(awk '/<version>/,/<\/version>/' pom.xml | head -n 1 | sed 's/^[[:space:]]*//g' | sed -n 's:.*<version>\(.*\)</version>.*:\1:p')" >> $GITHUB_OUTPUT
16+
echo "artifact=$(awk '/<artifactId>/,/<\/artifactId>/' pom.xml | head -n 1 | sed 's/^[[:space:]]*//g' | sed -n 's:.*<artifactId>\(.*\)</artifactId>.*:\1:p')" >> $GITHUB_OUTPUT
17+
id: info
18+
- name: Check SNAPSHOT version
19+
if: ${{ !endsWith(steps.info.outputs.version, '-SNAPSHOT') }}
20+
run: |
21+
echo "Version from pom.xml does not match template SNAPSHOT!"
22+
exit 1
23+
- name: Install Java 11
24+
uses: actions/setup-java@v3
25+
with:
26+
distribution: 'temurin'
27+
java-version: '11'
28+
server-id: ossrh
29+
server-username: MAVEN_USERNAME
30+
server-password: MAVEN_PASSWORD
31+
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
32+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
33+
- name: Submodules update
34+
run: |
35+
cd ${{ github.workspace }}
36+
cwd=$(pwd)
37+
git submodule update --init --recursive
38+
- name: Publish to the Maven Central Repository
39+
run: |
40+
mvn --no-transfer-progress --batch-mode deploy
41+
env:
42+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
43+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
44+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

demo-example/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<dependency>
2929
<groupId>com.onlyoffice</groupId>
3030
<artifactId>docs-integration-sdk</artifactId>
31-
<version>0.0.1-SNAPSHOT</version>
31+
<version>1.1.2</version>
3232
</dependency>
3333
<dependency>
3434
<groupId>com.fasterxml.jackson.core</groupId>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.onlyoffice</groupId>
88
<artifactId>docs-integration-sdk</artifactId>
9-
<version>1.1.2</version>
9+
<version>1.1.3-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>${project.groupId}:${project.artifactId}</name>

0 commit comments

Comments
 (0)