Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-onsha committed May 27, 2024
2 parents f8f23d6 + 1089a4d commit 3278dae
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
name: Java CI

on:
pull_request:
branches:
- master
- develop
paths:
- 'plugin/**'
push:
branches:
- master
paths:
- 'plugin/**'
release:
types:
- published
paths:
- 'plugin/**'
workflow_dispatch:

jobs:
maven:
uses: ./.github/workflows/maven.yml
if: github.repository_owner == 'epam'

release-snapshot-to-maven-central:
name: Publish SNAPSHOT package to MavenCentral
environment: release-snapshot
if: github.repository_owner == 'epam' && github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build-java

steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
server-id: ossrh
server-username: OSS_SONATYPE_USERNAME
server-password: OSS_SONATYPE_TOKEN
cache: 'maven'
settings-path: ${{ github.workspace }}
- name: Set SNAPSHOT in version
run: |
syndicate_plugin_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file ./plugin/pom.xml | xargs)
mvn versions:set -DnewVersion="${syndicate_plugin_version}-SNAPSHOT" --file ./plugin/pom.xml
mvn versions:commit --file ./plugin/pom.xml
- name: Build with Maven
run: mvn -B package --file ./plugin/pom.xml
- name: Deploy development version binaries (Snapshots)
env:
OSS_SONATYPE_USERNAME: ${{ vars.OSSRH_USERNAME }}
OSS_SONATYPE_TOKEN: ${{ secrets.OSSRH_TOKEN }}
run: |
echo Checking variables ${{ secrets.OSSRH_USERNAME }}
cat $GITHUB_WORKSPACE/settings.xml
mvn clean deploy -B --file ./plugin/pom.xml --settings $GITHUB_WORKSPACE/settings.xml
# Upload to MavenCentral on every GitHub Release
release-to-maven-central:
name: Publish released package to MavenCentral
environment: release-maven-central
if: github.repository_owner == 'epam' && github.event.action == 'published'
runs-on: ubuntu-latest
needs: build-java

steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
cache: 'maven'
- name: Build with Maven
run: mvn -B package --file ./plugin/pom.xml
- name: Publish to Maven Central
run: |
# -U force updates just to make sure we are using latest dependencies
# -B Batch mode (do not ask for user input), just in case
# -P activate profile
mvn -U -B clean deploy -P release --file ./plugin/pom.xml
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
27 changes: 27 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Build and Run Tests by Maven

on:
workflow_call:

jobs:
build-java:
name: "maven-compile (${{ matrix.os }}, JDK-${{ matrix.jdk }}), Distribution ${{ matrix.distribution }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
jdk: [ 17, 21 ]
distribution: [ corretto, oracle ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: ${{ matrix.distribution }}
cache: "maven"
- name: Build with Maven
run: mvn -B package --file ./plugin/pom.xml
4 changes: 4 additions & 0 deletions .github/workflows/pypi-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
push:
branches: ["master"]
tags: ["*"]
paths:
- '**.py'
release:
types:
- published
paths:
- '**.py'
workflow_dispatch:

permissions:
Expand Down

0 comments on commit 3278dae

Please sign in to comment.