From d9d4e25f4816623bf98c2c23684e26b881c58b86 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Thu, 3 Feb 2022 13:28:55 +0530 Subject: [PATCH 1/9] Added Makefile for mvn and updated the github workflow --- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ .github/workflows/verify.yml | 35 +++++++++++++++++++++++++ Makefile | 28 ++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/verify.yml create mode 100644 Makefile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a9ecbe9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +# This GitHub action can publish assets for release when a tag is created. +# Currently, it's setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). + +name: release +on: + push: + tags: + - 'v*' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2.4.0 + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: Install Maven + run: | + curl -sL https://www-eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip + apt-get update + apt-get -y install unzip + unzip -d /usr/share maven.zip + rm maven.zip + ln -s /usr/share/apache-maven-3.6.3/bin/mvn /usr/bin/mvn + echo "M2_HOME=/usr/share/apache-maven-3.6.3" | tee -a /etc/environment + shell: sh + + - name: Run tests + run: make test + shell: sh + + - name: Build and Publish package + run: make deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + shell: sh + \ No newline at end of file diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 0000000..3338a74 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,35 @@ +name: verify + +on: + pull_request: + branches: [ '*' ] + push: + branches: [ master ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.4.0 + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Install Maven + run: | + curl -sL https://www-eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip + apt-get update + apt-get -y install unzip + unzip -d /usr/share maven.zip + rm maven.zip + ln -s /usr/share/apache-maven-3.6.3/bin/mvn /usr/bin/mvn + echo "M2_HOME=/usr/share/apache-maven-3.6.3" | tee -a /etc/environment + shell: sh + + - name: Run test + run: make test + shell: sh \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0e38dd8 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +SHELL=bash + +# Check that the required version of make is being used +REQ_MAKE_VER:=3.82 +ifneq ($(REQ_MAKE_VER),$(firstword $(sort $(MAKE_VERSION) $(REQ_MAKE_VER)))) + $(error The version of MAKE $(REQ_MAKE_VER) or higher is required; you are running $(MAKE_VERSION)) +endif + +.ONESHELL: + +all: package test + +.PHONY: clean +clean: + mvn clean --file pom.xml + +.PHONY: test +test: clean + mvn test --file pom.xml + +.PHONY: package +package: clean + mvn package --file pom.xml + +.PHONY: deploy +deploy: package + mvn --batch-mode deploy --file pom.xml + From ea44a8d48271ea19c3058d1fe10da5d5d93f7ef1 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Tue, 8 Feb 2022 15:41:37 +0530 Subject: [PATCH 2/9] Added gpg sign in maven artifacts --- .github/workflows/release.yml | 27 ++++++++++--------- pom.xml | 50 ++++++++++++----------------------- 2 files changed, 31 insertions(+), 46 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9ecbe9..8314bd9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,9 +3,8 @@ name: release on: - push: - tags: - - 'v*' + pull_request: + branches: [ '*' ] jobs: build: @@ -15,14 +14,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.4.0 - - - name: Set up JDK 1.8 + + - name: Set up Apache Maven Central uses: actions/setup-java@v1 - with: + with: # running setup-java again overwrites the settings.xml java-version: 1.8 - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.PUBLISH_SIGNING_KEY }} # Value of the GPG private key to import + gpg-passphrase: GPG_PRIVATE_KEY_PASSPHRASE - name: Install Maven run: | @@ -41,8 +42,8 @@ jobs: - name: Build and Publish package run: make deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} shell: sh - \ No newline at end of file + env: + MAVEN_USERNAME: ${{ secrets.PUBLISH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }} + GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.PUBLISH_SIGNING_KEY_PASSPHRASE }} diff --git a/pom.xml b/pom.xml index 59909d3..befd8c9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,44 +5,25 @@ vinyldns-java 0.9.4-SNAPSHOT - - scm:git:ssh://git@github.com/${vinyldns-fork}/vinyldns-java.git - scm:git:ssh://git@github.com/${vinyldns-fork}/vinyldns-java.git - http://github.com/vinyldns/vinyldns-java - HEAD + + scm:git:git://github.com/vinyldns/vinyldns-java.git + scm:git:ssh://github.com:vinyldns/vinyldns-java.git + http://github.com/vinyldns/vinyldns-java vinyldns-java java client for https://vinyldns.io https://vinyldns.io - - - pauljamescleary - Paul Cleary - pauljamescleary@gmail.com - - - rebstar6 - Rebecca Star - rebstar6@gmail.com - - - nimaeskandary - Nima Eskandary - nimaesk1@gmail.com - - - mitruly - Michael Ly - michaeltrulyng@gmail.com - - - britneywright - Britney Wright - blw06g@gmail.com - - + + + VinylDNS Maintainers + vinyldns-core@googlegroups.com + VinylDNS + https://github.com/vinyldns/vinyldns-java + + + The Apache Software License, Version 2.0 @@ -327,7 +308,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 sign-artifacts @@ -335,6 +316,9 @@ sign + + ${{ secrets.PUBLISH_SIGNING_KEY_NAME }} + From 3c73a487c5bb18296aad5da462322e85f5375104 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Tue, 8 Feb 2022 16:39:33 +0530 Subject: [PATCH 3/9] update --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8314bd9..4d4d27f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,7 @@ name: release on: - pull_request: - branches: [ '*' ] + create jobs: build: From b85ef06eab6d5d17ddcad42b274cb45b22353e96 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Tue, 8 Feb 2022 16:43:05 +0530 Subject: [PATCH 4/9] update --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d4d27f..f96d756 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,7 @@ # Currently, it's setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). name: release -on: - create +on: [push, pull_request] jobs: build: From f9fed21830b427ec7628e7722a30dced9a6434e9 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Tue, 8 Feb 2022 16:47:08 +0530 Subject: [PATCH 5/9] update --- .github/workflows/release.yml | 13 +------------ .github/workflows/verify.yml | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f96d756..8358ce9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,20 +23,9 @@ jobs: gpg-private-key: ${{ secrets.PUBLISH_SIGNING_KEY }} # Value of the GPG private key to import gpg-passphrase: GPG_PRIVATE_KEY_PASSPHRASE - - name: Install Maven - run: | - curl -sL https://www-eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip - apt-get update - apt-get -y install unzip - unzip -d /usr/share maven.zip - rm maven.zip - ln -s /usr/share/apache-maven-3.6.3/bin/mvn /usr/bin/mvn - echo "M2_HOME=/usr/share/apache-maven-3.6.3" | tee -a /etc/environment - shell: sh - - name: Run tests run: make test - shell: sh + shell: bash - name: Build and Publish package run: make deploy diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 3338a74..9a3b708 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -19,17 +19,6 @@ jobs: with: java-version: 1.8 - - name: Install Maven - run: | - curl -sL https://www-eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip - apt-get update - apt-get -y install unzip - unzip -d /usr/share maven.zip - rm maven.zip - ln -s /usr/share/apache-maven-3.6.3/bin/mvn /usr/bin/mvn - echo "M2_HOME=/usr/share/apache-maven-3.6.3" | tee -a /etc/environment - shell: sh - - name: Run test run: make test - shell: sh \ No newline at end of file + shell: bash From da691a8fb8d6bb00d3b1776af056fdb398e87876 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Tue, 8 Feb 2022 16:57:33 +0530 Subject: [PATCH 6/9] update --- MAINTAINERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 5a896d0..e136cb0 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -46,7 +46,7 @@ To release to Sonatype, make a `settings.xml` in `~/.m2` https://maven.apache.or The following information must be provided: * SONATYPE_USERNAME - oss.sonatype.org login for io.vinyldns -* SONATYPE_USERNAME - oss.sonatype.org password for io.vinyldns +* SONATYPE_PASSWORD - oss.sonatype.org password for io.vinyldns * GITHUB_USERNAME - Github username that your fork is published to * KEY_PASSPHRASE - passphrase for key F6D171DC24C6EB30FCAC1E85AEF7D1D58E3C1B9A From 0d9f6d392c385f4ba5bef1018b3e8b3d4199ac16 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Tue, 8 Feb 2022 17:13:35 +0530 Subject: [PATCH 7/9] update in release.yml --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8358ce9..84f9922 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,10 @@ # Currently, it's setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). name: release -on: [push, pull_request] +on: + push: + tags: + - 'v*' jobs: build: From f0b3510fa487c1fb9439dfc12cbceab80c16fe03 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Tue, 8 Feb 2022 17:15:14 +0530 Subject: [PATCH 8/9] update in release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84f9922..ada308c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: - name: Build and Publish package run: make deploy - shell: sh + shell: bash env: MAVEN_USERNAME: ${{ secrets.PUBLISH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }} From a320ca839af4d5c533dfe35100c413ed91600ed7 Mon Sep 17 00:00:00 2001 From: Jay07GIT Date: Wed, 9 Feb 2022 10:10:14 +0530 Subject: [PATCH 9/9] updated gpg key name as plaintext --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index befd8c9..a9d1500 100644 --- a/pom.xml +++ b/pom.xml @@ -317,7 +317,7 @@ sign - ${{ secrets.PUBLISH_SIGNING_KEY_NAME }} + F6D171DC24C6EB30FCAC1E85AEF7D1D58E3C1B9A