diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce254c8..114eb70 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,24 +1,19 @@ name: Run tests -on: [pull_request] +on: [ pull_request ] jobs: unit-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.7 - uses: actions/setup-java@v1 - with: - java-version: 1.7 - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Test - run: mvn clean install -DskipTests=false --update-snapshots -q + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + - name: Test + run: mvn clean install -DskipTests=false --update-snapshots -q artifact: name: Publish - Nexus @@ -26,14 +21,16 @@ jobs: needs: unit-test steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11.0.4 + java-version: 11 + distribution: temurin + - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - nexus_username: ${{ secrets.nexus_username }} - nexus_password: ${{ secrets.nexus_password }} - maven_profiles: "branch" \ No newline at end of file + env: + SONATYPE_PORTAL_USERNAME: ${{ secrets.SONATYPE_PORTAL_USERNAME }} + SONATYPE_PORTAL_PASSWORD: ${{ secrets.SONATYPE_PORTAL_PASSWORD }} + run: | + mvn clean deploy --settings .mvn/settings.xml -Dmaven.test.skip=true -B diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 0898096..1006fbd 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -9,17 +9,12 @@ jobs: unit-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.7 - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 with: - java-version: 1.7 - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + java-version: 11 + distribution: temurin - name: Test run: mvn clean install -DskipTests=false --update-snapshots -q @@ -29,18 +24,23 @@ jobs: needs: unit-test steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11.0.4 + java-version: 11 + distribution: temurin + - name: Remove snapshot run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + - name: Release Maven package - uses: samuelmeuli/action-maven-publish@v1 - with: - nexus_username: ${{ secrets.nexus_username }} - nexus_password: ${{ secrets.nexus_password }} - gpg_private_key: ${{ secrets.PGP_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.PGP_PASSPHRASE }} - maven_profiles: "master" + env: + SONATYPE_PORTAL_USERNAME: ${{ secrets.SONATYPE_PORTAL_USERNAME }} + SONATYPE_PORTAL_PASSWORD: ${{ secrets.SONATYPE_PORTAL_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + GPG_SECRET_KEYS: ${{ secrets.PGP_PRIVATE_KEY }} + run: | + echo -e "$GPG_SECRET_KEYS" | gpg --import --no-tty --batch --yes + mvn clean deploy --settings .mvn/settings.xml -Dgpg.skip=false -Dmaven.test.skip=true -B + diff --git a/.mvn/settings.xml b/.mvn/settings.xml new file mode 100644 index 0000000..c27552b --- /dev/null +++ b/.mvn/settings.xml @@ -0,0 +1,26 @@ + + + + + + central + ${env.SONATYPE_PORTAL_USERNAME} + ${env.SONATYPE_PORTAL_PASSWORD} + + + + + + central + + true + + + gpg + ${env.GPG_PASSPHRASE} + + + + diff --git a/pom.xml b/pom.xml index 34041c1..191e272 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ jar DHIS Antlr Expression Parser org.hisp.dhis.parser - 1.0.36 + 1.0.37-SNAPSHOT Antlr Expression Parser @@ -88,6 +88,7 @@ true true 4.9.3 + true @@ -100,94 +101,6 @@ - - branch - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 - - - enforce-no-releases - - enforce - - - - - No Releases Allowed! - - - true - - - - - - - - - master - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 - - - enforce-no-snapshots - - enforce - - - - - No Snapshots Allowed! - - - true - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://oss.sonatype.org/ - true - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - - --pinentry-mode - loopback - - - - - - - - @@ -239,13 +152,36 @@ + + org.apache.maven.plugins + maven-gpg-plugin + 3.0.1 + + + --pinentry-mode + loopback + + + + + verify + + sign + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + true + DHIS2 ANTLR Expression Parser + + - - - ossrh - Sonatype OSS - https://oss.sonatype.org/content/repositories/snapshots - -