From 984669b9cf4a1de3525ef0b63d25cac24c93b5d9 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 16:00:48 +0100 Subject: [PATCH 01/15] prepare CI to abandon bintray --- .github/workflows/build.yml | 18 +----- .github/workflows/publish-central.yml | 31 ++++++++++ .github/workflows/publish-github.yml | 31 ++++++++++ pom.xml | 86 +++++++++++++++++++-------- 4 files changed, 124 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/publish-central.yml create mode 100644 .github/workflows/publish-github.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c1f91c..7ffc029 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,23 +7,16 @@ jobs: build: name: Build and Test runs-on: ubuntu-latest - #This check is case insensitive if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" env: BUILD_VERSION: SNAPSHOT - # Name of the project; used in multiple steps (e.g. for upload) PROJECT_NAME: webdav-nio-adapter-servlet steps: - # Foreign Action: Checkout the current commit - uses: actions/checkout@v2 - # Foreign Action: Setup Java Runtime Environment - uses: actions/setup-java@v1 with: java-version: 11 - server-id: bintray-jcenter - server-username: BINTRAY_USERNAME # Defined in step "deploytojcenter" - server-password: BINTRAY_API_KEY # See above - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -52,11 +45,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ env.PROJECT_NAME }}-${{ env.BUILD_VERSION }}.jar - path: target/${{ env.PROJECT_NAME }}-*.jar - - name: Deploy to jcenter - id: deployToJcenter - run: mvn -B deploy -Prelease -DskipTests - if: startsWith(github.ref, 'refs/tags/') # Run if ref is tagged (e.g. "v.1.4") - env: - BINTRAY_USERNAME: cryptobot - BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} + path: target/${{ env.PROJECT_NAME }}-*.jar \ No newline at end of file diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml new file mode 100644 index 0000000..6b9e0cf --- /dev/null +++ b/.github/workflows/publish-central.yml @@ -0,0 +1,31 @@ +name: Publish to Maven Central +on: + workflow_dispatch +jobs: + build: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: RELEASES_GPG_PASSPHRASE # env variable for GPG private key passphrase + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Apply version from tag + run: mvn versions:set -B -DnewVersion=${GITHUB_REF##*/} + - name: Deploy + run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml new file mode 100644 index 0000000..15b80e0 --- /dev/null +++ b/.github/workflows/publish-github.yml @@ -0,0 +1,31 @@ +name: Publish to GitHub Packages +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 11 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: RELEASES_GPG_PASSPHRASE # env variable for GPG private key passphrase + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Apply version from tag + run: mvn versions:set -B -DnewVersion=${GITHUB_REF##*/} + - name: Deploy + run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress + env: + MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} + MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 558ad12..6ede022 100644 --- a/pom.xml +++ b/pom.xml @@ -42,9 +42,8 @@ - bintray - bintray - http://jcenter.bintray.com + central + https://repo1.maven.org/maven2 @@ -126,6 +125,30 @@ true + + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + maven-javadoc-plugin + 3.2.0 + + + attach-javadocs + + jar + + + + @@ -176,42 +199,53 @@ - release - - - bintray-jcenter - https://api.bintray.com/maven/cryptomator/maven/webdav-nio-adapter-servlet/;publish=1 - - + sign - maven-source-plugin - 3.2.1 - - - attach-sources - - jar-no-fork - - - - - - maven-javadoc-plugin - 3.2.0 + maven-gpg-plugin + 1.6 - attach-javadocs + sign-artifacts + verify - jar + sign + + + --pinentry-mode + loopback + + + + + deploy-central + + + ossrh + Maven Central + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + deploy-github + + + github + GitHub Packages + https://maven.pkg.github.com/cryptomator/webdav-nio-adapter + + + From cded6f14a4a2a6cf6fcdd0ec95851a78fe8a3f1d Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 16:06:49 +0100 Subject: [PATCH 02/15] preparing 1.0.10 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ede022..7e8fc7b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.cryptomator webdav-nio-adapter-servlet - 1.1.0-SNAPSHOT + 1.0.10 WebDAV-NIO Adapter Servlet Servlet serving NIO directory contents as WebDAV resources. https://github.com/cryptomator/webdav-nio-adapter-servlet From f6212a96196c32cefdeaad4240cffcc1242b6cf9 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 16:33:02 +0100 Subject: [PATCH 03/15] attempt using default values for settings.xml --- .github/workflows/publish-github.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 15b80e0..db9fdd6 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -10,9 +10,9 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 11 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME # env variable for username in deploy - server-password: MAVEN_PASSWORD # env variable for token in deploy + #server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + #server-username: MAVEN_USERNAME # env variable for username in deploy + #server-password: MAVEN_PASSWORD # env variable for token in deploy gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import gpg-passphrase: RELEASES_GPG_PASSPHRASE # env variable for GPG private key passphrase - uses: actions/cache@v2 @@ -26,6 +26,6 @@ jobs: - name: Deploy run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress env: - MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} - MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + #MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} + #MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file From 97285aa50fcb413e2a7407b9fdb57a2e13365561 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 17:35:31 +0100 Subject: [PATCH 04/15] Revert "attempt using default values for settings.xml" This reverts commit f6212a96196c32cefdeaad4240cffcc1242b6cf9. --- .github/workflows/publish-github.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index db9fdd6..15b80e0 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -10,9 +10,9 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 11 - #server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - #server-username: MAVEN_USERNAME # env variable for username in deploy - #server-password: MAVEN_PASSWORD # env variable for token in deploy + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import gpg-passphrase: RELEASES_GPG_PASSPHRASE # env variable for GPG private key passphrase - uses: actions/cache@v2 @@ -26,6 +26,6 @@ jobs: - name: Deploy run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress env: - #MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} - #MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} + MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file From 707612f09a01f1687c9186806c7c4c821f1ae95b Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 17:46:32 +0100 Subject: [PATCH 05/15] fixed ci config --- .github/workflows/publish-central.yml | 4 ++-- .github/workflows/publish-github.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index 6b9e0cf..600cc08 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -14,7 +14,7 @@ jobs: server-username: MAVEN_USERNAME # env variable for username in deploy server-password: MAVEN_PASSWORD # env variable for token in deploy gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import - gpg-passphrase: RELEASES_GPG_PASSPHRASE # env variable for GPG private key passphrase + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - uses: actions/cache@v2 with: path: ~/.m2/repository @@ -28,4 +28,4 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} \ No newline at end of file diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 15b80e0..ba0d396 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -14,7 +14,7 @@ jobs: server-username: MAVEN_USERNAME # env variable for username in deploy server-password: MAVEN_PASSWORD # env variable for token in deploy gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import - gpg-passphrase: RELEASES_GPG_PASSPHRASE # env variable for GPG private key passphrase + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - uses: actions/cache@v2 with: path: ~/.m2/repository @@ -28,4 +28,4 @@ jobs: env: MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} \ No newline at end of file From 7a7979f2e56449f0c4f7afc27c9bd61105c1a3bb Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 17:53:08 +0100 Subject: [PATCH 06/15] fix repo url --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e8fc7b..6ba14a5 100644 --- a/pom.xml +++ b/pom.xml @@ -242,7 +242,7 @@ github GitHub Packages - https://maven.pkg.github.com/cryptomator/webdav-nio-adapter + https://maven.pkg.github.com/cryptomator/webdav-nio-adapter-servlet From e6b7b7a6e83720b36b9be9f1c3c00f8f905d3318 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 18:02:26 +0100 Subject: [PATCH 07/15] attempt using default values for settings.xml --- .github/workflows/publish-github.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index ba0d396..34db435 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -10,9 +10,9 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 11 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME # env variable for username in deploy - server-password: MAVEN_PASSWORD # env variable for token in deploy + #server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + #server-username: MAVEN_USERNAME # env variable for username in deploy + #server-password: MAVEN_PASSWORD # env variable for token in deploy gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - uses: actions/cache@v2 @@ -26,6 +26,7 @@ jobs: - name: Deploy run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress env: - MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} - MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + #MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} + #MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} \ No newline at end of file From 04763eb2e47631018555fab1e64f38bdddcdae59 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Thu, 4 Feb 2021 18:10:03 +0100 Subject: [PATCH 08/15] remove unused config [ci skip] --- .github/workflows/publish-github.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 34db435..ab010e1 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -10,9 +10,6 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 11 - #server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - #server-username: MAVEN_USERNAME # env variable for username in deploy - #server-password: MAVEN_PASSWORD # env variable for token in deploy gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - uses: actions/cache@v2 @@ -27,6 +24,4 @@ jobs: run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - #MAVEN_USERNAME: ${{ env.GITHUB_ACTOR }} - #MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} \ No newline at end of file From 4f3a5d2c3bd0c94bcc773da4e494aed946dfa54e Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 8 Feb 2021 11:15:08 +0100 Subject: [PATCH 09/15] updated CI --- .github/workflows/build.yml | 33 ++++++++++++++++----------- .github/workflows/publish-central.yml | 3 ++- .github/workflows/publish-github.yml | 3 ++- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ffc029..6b7a544 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,9 +8,6 @@ jobs: name: Build and Test runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" - env: - BUILD_VERSION: SNAPSHOT - PROJECT_NAME: webdav-nio-adapter-servlet steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 @@ -26,11 +23,6 @@ jobs: id: taggedVersion run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} if: startsWith(github.ref, 'refs/tags/') # Run if ref is tagged (e.g. "v.1.4") - - name: Export the project version to the job environment and fix it as an ouput of this step - id: setVersion - run: | - v=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout) - echo "BUILD_VERSION=${v}" >> $GITHUB_ENV - name: Build and Test id: buildAndTest run: mvn -B clean install jacoco:report -Pcoverage,dependency-check @@ -40,9 +32,24 @@ jobs: env: CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} continue-on-error: true - - name: Upload snapshot artifact ${{ env.PROJECT_NAME }}-${{ env.BUILD_VERSION }}.jar - id: uploadSnapshot - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v2 with: - name: ${{ env.PROJECT_NAME }}-${{ env.BUILD_VERSION }}.jar - path: target/${{ env.PROJECT_NAME }}-*.jar \ No newline at end of file + name: artifacts + path: target/*.jar + + release: + name: Release + if: startsWith(github.ref, 'refs/tags/') + needs: build + steps: + - name: Draft a release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + :construction: Work in Progress + draft: true + prerelease: true diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index 600cc08..265cf1a 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -1,6 +1,7 @@ name: Publish to Maven Central on: - workflow_dispatch + release: + types: [released] jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index ab010e1..a43ac64 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -1,10 +1,11 @@ name: Publish to GitHub Packages on: release: - types: [created] + types: [prereleased, released] jobs: publish: runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 From 54b57de336ea4e745699fbcf48fc3ca1ff64e5c1 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 8 Feb 2021 11:15:59 +0100 Subject: [PATCH 10/15] fixed CI config --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b7a544..1ffa5d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,7 @@ jobs: release: name: Release + runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') needs: build steps: From a28d0c0196dc2e25f2002f089b241304db49a19c Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 8 Feb 2021 11:25:23 +0100 Subject: [PATCH 11/15] workflow was not triggered, when I published a drafted release --- .github/workflows/publish-central.yml | 4 ++-- .github/workflows/publish-github.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index 265cf1a..5c5ead8 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -1,11 +1,11 @@ name: Publish to Maven Central on: release: - types: [released] + types: [published, edited, released] jobs: build: runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions + if: startsWith(github.ref, 'refs/tags/') && !github.event.release.prerelease # only allow publishing non-prereleased tagged versions steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index a43ac64..fa68599 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -1,7 +1,7 @@ name: Publish to GitHub Packages on: release: - types: [prereleased, released] + types: [published, edited, prereleased, released] jobs: publish: runs-on: ubuntu-latest From 268c24b0b165f3a2953cee8bc9901321aaca8649 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 8 Feb 2021 12:36:18 +0100 Subject: [PATCH 12/15] =?UTF-8?q?Changed=20workflow=20integration:=20build?= =?UTF-8?q?=20=E2=86=92=20release=20=E2=86=92=20publish=20to=20GH=20?= =?UTF-8?q?=E2=86=92=20slack=20notify=20=E2=86=92=20(manually)=20publish?= =?UTF-8?q?=20to=20central?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 18 ++++-------------- .github/workflows/publish-central.yml | 15 ++++++++++----- .github/workflows/publish-github.yml | 19 +++++++++++++++---- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ffa5d9..9689593 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,9 +20,8 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Ensure to use tagged version - id: taggedVersion + if: startsWith(github.ref, 'refs/tags/') run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} - if: startsWith(github.ref, 'refs/tags/') # Run if ref is tagged (e.g. "v.1.4") - name: Build and Test id: buildAndTest run: mvn -B clean install jacoco:report -Pcoverage,dependency-check @@ -36,21 +35,12 @@ jobs: with: name: artifacts path: target/*.jar - - release: - name: Release - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - needs: build - steps: - - name: Draft a release + - name: Create Release uses: actions/create-release@v1 + if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} - body: | - :construction: Work in Progress - draft: true - prerelease: true + prerelease: true \ No newline at end of file diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index 5c5ead8..3575e0c 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -1,13 +1,18 @@ name: Publish to Maven Central on: - release: - types: [published, edited, released] + workflow_dispatch: + inputs: + tag: + description: 'Tag' + required: true + default: '0.0.0' jobs: build: runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') && !github.event.release.prerelease # only allow publishing non-prereleased tagged versions steps: - uses: actions/checkout@v2 + with: + ref: "refs/tags/${{ github.event.inputs.tag }}" - uses: actions/setup-java@v1 with: java-version: 11 @@ -22,8 +27,8 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - name: Apply version from tag - run: mvn versions:set -B -DnewVersion=${GITHUB_REF##*/} + - name: Enforce project version ${{ github.event.inputs.tag }} + run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }} - name: Deploy run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress env: diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index fa68599..8ca0648 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -1,7 +1,7 @@ name: Publish to GitHub Packages on: release: - types: [published, edited, prereleased, released] + types: [published] jobs: publish: runs-on: ubuntu-latest @@ -19,10 +19,21 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - name: Apply version from tag - run: mvn versions:set -B -DnewVersion=${GITHUB_REF##*/} + - name: Enforce project version ${{ github.event.release.tag_name }} + run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }} - name: Deploy run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }} + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_USERNAME: 'Cryptobot' + SLACK_ICON: + SLACK_ICON_EMOJI: ':bot:' + SLACK_CHANNEL: 'debug' + SLACK_TITLE: "Published ${{ github.event.repository.name }} version ${{ github.event.release.tag_name }}" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + MSG_MINIMAL: true + SLACK_MESSAGE: "Ready to deploy to Maven Central: https://github.com/${{ github.repository }}/actions?query=workflow%3A%22Publish+to+Maven+Central%22" \ No newline at end of file From 28fe9cb80a250f252e27321f83717a50bc8c5308 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 8 Feb 2021 13:14:28 +0100 Subject: [PATCH 13/15] use PAT to create releases --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9689593..36fde6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,6 @@ name: Build - on: [push] - jobs: build: name: Build and Test @@ -39,7 +37,7 @@ jobs: uses: actions/create-release@v1 if: startsWith(github.ref, 'refs/tags/') env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot" with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} From 79bf3d263aa2daa07c9e968f171347ed37f9b896 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 8 Feb 2021 13:31:33 +0100 Subject: [PATCH 14/15] cleanup [ci skip] --- .github/workflows/publish-github.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 8ca0648..45cfbe7 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -29,11 +29,12 @@ jobs: - name: Slack Notification uses: rtCamp/action-slack-notify@v2 env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} SLACK_USERNAME: 'Cryptobot' SLACK_ICON: SLACK_ICON_EMOJI: ':bot:' SLACK_CHANNEL: 'debug' - SLACK_TITLE: "Published ${{ github.event.repository.name }} version ${{ github.event.release.tag_name }}" - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} - MSG_MINIMAL: true - SLACK_MESSAGE: "Ready to deploy to Maven Central: https://github.com/${{ github.repository }}/actions?query=workflow%3A%22Publish+to+Maven+Central%22" \ No newline at end of file + SLACK_TITLE: "Published ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}" + SLACK_MESSAGE: "Ready to ." + SLACK_FOOTER: + MSG_MINIMAL: true \ No newline at end of file From 1f6c8496062bf0a3f6eaf4f4aed35a7f606131ec Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 8 Feb 2021 13:34:44 +0100 Subject: [PATCH 15/15] central is default, anyway --- pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pom.xml b/pom.xml index 6ba14a5..621e590 100644 --- a/pom.xml +++ b/pom.xml @@ -40,13 +40,6 @@ - - - central - https://repo1.maven.org/maven2 - - -