Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/feature/github-actions'
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandrfedorov97 committed Apr 2, 2024
2 parents 55533cf + b8ff4f0 commit 5767f21
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish SNAPSHOT

on:
workflow_dispatch:

jobs:
artifact:
environment: production
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Info
run: |
echo "version=$(awk '/<version>/,/<\/version>/' pom.xml | head -n 1 | sed 's/^[[:space:]]*//g' | sed -n 's:.*<version>\(.*\)</version>.*:\1:p')" >> $GITHUB_OUTPUT
echo "artifact=$(awk '/<artifactId>/,/<\/artifactId>/' pom.xml | head -n 1 | sed 's/^[[:space:]]*//g' | sed -n 's:.*<artifactId>\(.*\)</artifactId>.*:\1:p')" >> $GITHUB_OUTPUT
id: info
- name: Check SNAPSHOT version
if: ${{ !endsWith(steps.info.outputs.version, '-SNAPSHOT') }}
run: |
echo "Version from pom.xml does not match template SNAPSHOT!"
exit 1
- name: Install Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Submodules update
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
- name: Publish to the Maven Central Repository
run: |
mvn --no-transfer-progress --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
2 changes: 1 addition & 1 deletion demo-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>com.onlyoffice</groupId>
<artifactId>docs-integration-sdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.onlyoffice</groupId>
<artifactId>docs-integration-sdk</artifactId>
<version>1.1.2</version>
<version>1.1.3-SNAPSHOT</version>
<packaging>jar</packaging>

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

0 comments on commit 5767f21

Please sign in to comment.