From 309169393bc32c734b353a37cf52b0db3ae0e94b Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:15:24 +0800 Subject: [PATCH 01/15] ci: add steps used to publish artefacts to maven central --- .github/workflows/github-packages-publish.yml | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index e8bd3cf..64f807d 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -20,7 +20,19 @@ jobs: packages: write steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + + - name: Import PGP Private Key + uses: crazy-max/ghaction-import-gpg@v6.1.0 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + + - name: Creating PGP Ring Key + run: | + mkdir -p ~/.gnupg + gpg --export-secret-keys -o ~/.gnupg/pgp_key.ring - name: Restore gradle.properties env: @@ -31,14 +43,6 @@ jobs: echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle" echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties - - name: Restore gpg secret ring file - env: - GPG_SECRET_KEY_RING: ${{ secrets.GPG_SECRET_KEY_RING }} - shell: bash - run: | - mkdir -p ~/.gnupg/ - echo ${GPG_SECRET_KEY_RING} > ~/.gnupg/42CBCB82.gpg - - name: Set up JDK 17 uses: actions/setup-java@v4 with: @@ -58,8 +62,11 @@ jobs: # The USERNAME and TOKEN need to correspond to the credentials environment variables used in # the publishing section of your build.gradle - - name: Publish to GitHub Packages - run: ./gradlew publishAllPublicationsToGithubPackagesRepository - env: - USERNAME: ${{ github.actor }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} +# - name: Publish to GitHub Packages +# run: ./gradlew publishAllPublicationsToGithubPackagesRepository +# env: +# USERNAME: ${{ github.actor }} +# TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to Maven Central + run: ./gradlew publish From d3e5bf84b3245f779d4064d7394fdaac55ea799d Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:16:15 +0800 Subject: [PATCH 02/15] ci: add steps used to publish artefacts to maven central --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 408483d..c42000f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0 +buildVersion=1.4.0-test-github-actions projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From 66d933f4d03dd1a146c70757dea9a4c0d69fc033 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:22:55 +0800 Subject: [PATCH 03/15] ci: fix creating secret key ring file --- .github/workflows/github-packages-publish.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index 64f807d..027d620 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -30,9 +30,7 @@ jobs: passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Creating PGP Ring Key - run: | - mkdir -p ~/.gnupg - gpg --export-secret-keys -o ~/.gnupg/pgp_key.ring + run: gpg --export-secret-keys -o ~/.gnupg/pgp_key.ring - name: Restore gradle.properties env: From d8df8f0fe9f7fd3309137e60f5d1b129de880268 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:24:35 +0800 Subject: [PATCH 04/15] ci: fix creating secret key ring file --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c42000f..8d1e99f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0-test-github-actions +buildVersion=1.4.0-test-github-actions-1 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From 2a514890739d0986f3284789e8953b025b949637 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:26:52 +0800 Subject: [PATCH 05/15] ci: fix creating secret key ring file --- .github/workflows/github-packages-publish.yml | 1 + gradle.properties | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index 027d620..cbdc065 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -28,6 +28,7 @@ jobs: with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} + trust_level: 5 - name: Creating PGP Ring Key run: gpg --export-secret-keys -o ~/.gnupg/pgp_key.ring diff --git a/gradle.properties b/gradle.properties index 8d1e99f..9cbf5a5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0-test-github-actions-1 +buildVersion=1.4.0-test-github-actions-2 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From 882d7469c9187cd614d01b9b7fe4ec24db9c041b Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:29:53 +0800 Subject: [PATCH 06/15] ci: fix creating secret key ring file --- .github/workflows/github-packages-publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index cbdc065..fc4cc3c 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -23,6 +23,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Setup GPG TTY + run: export GPG_TTY=$(tty) + - name: Import PGP Private Key uses: crazy-max/ghaction-import-gpg@v6.1.0 with: From 4a89118b4900c7f809cc9365defb09f9344abc9e Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:30:15 +0800 Subject: [PATCH 07/15] ci: fix creating secret key ring file --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9cbf5a5..536ad80 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0-test-github-actions-2 +buildVersion=1.4.0-test-github-actions-3 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From a89f8225aa8c03dc965ff6e9ea720660661e3c59 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:37:03 +0800 Subject: [PATCH 08/15] ci: fix creating secret key ring file --- .github/workflows/github-packages-publish.yml | 4 ++++ gradle.properties | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index fc4cc3c..187ea98 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -33,6 +33,10 @@ jobs: passphrase: ${{ secrets.GPG_PASSPHRASE }} trust_level: 5 + - name: Check PGP Private Key + run: | + gpg --list-secret-keys --keyid-format LONG + - name: Creating PGP Ring Key run: gpg --export-secret-keys -o ~/.gnupg/pgp_key.ring diff --git a/gradle.properties b/gradle.properties index 536ad80..7720c07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0-test-github-actions-3 +buildVersion=1.4.0-test-github-actions-4 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From e73f8dd98f61c6e1488a69d42531a1a246b9cf5a Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:41:49 +0800 Subject: [PATCH 09/15] ci: fix creating secret key ring file --- .github/workflows/github-packages-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index 187ea98..24912ac 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -38,7 +38,7 @@ jobs: gpg --list-secret-keys --keyid-format LONG - name: Creating PGP Ring Key - run: gpg --export-secret-keys -o ~/.gnupg/pgp_key.ring + run: gpg --export-secret-keys -o ~/pgp_key.ring - name: Restore gradle.properties env: From 935d54cb13fa837eb00cf6a06f6a272c497dfd31 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 14:42:01 +0800 Subject: [PATCH 10/15] ci: fix creating secret key ring file --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 7720c07..7d390fa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0-test-github-actions-4 +buildVersion=1.4.0-test-github-actions-5 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From 4b0122a47154cf5d34872e1eff21d238a3109cd3 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 16:15:23 +0800 Subject: [PATCH 11/15] ci: fix creating secret key ring file --- .github/workflows/github-packages-publish.yml | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index 24912ac..bdafb69 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -38,41 +38,41 @@ jobs: gpg --list-secret-keys --keyid-format LONG - name: Creating PGP Ring Key - run: gpg --export-secret-keys -o ~/pgp_key.ring + run: echo ${{ secrets.GPG_PASSPHRASE }} - - name: Restore gradle.properties - env: - GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} - shell: bash - run: | - mkdir -p ~/.gradle/ - echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle" - echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'corretto' - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 - - - name: Grant Execution Authority to Gradlew - run: chmod +x ./gradlew - - - name: Build with Gradle - run: ./gradlew build - - # The USERNAME and TOKEN need to correspond to the credentials environment variables used in - # the publishing section of your build.gradle -# - name: Publish to GitHub Packages -# run: ./gradlew publishAllPublicationsToGithubPackagesRepository +# - name: Restore gradle.properties # env: -# USERNAME: ${{ github.actor }} -# TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish to Maven Central - run: ./gradlew publish +# GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} +# shell: bash +# run: | +# mkdir -p ~/.gradle/ +# echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle" +# echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties +# +# - name: Set up JDK 17 +# uses: actions/setup-java@v4 +# with: +# java-version: '17' +# distribution: 'corretto' +# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml +# settings-path: ${{ github.workspace }} # location for the settings.xml file +# +# - name: Setup Gradle +# uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 +# +# - name: Grant Execution Authority to Gradlew +# run: chmod +x ./gradlew +# +# - name: Build with Gradle +# run: ./gradlew build +# +# # The USERNAME and TOKEN need to correspond to the credentials environment variables used in +# # the publishing section of your build.gradle +## - name: Publish to GitHub Packages +## run: ./gradlew publishAllPublicationsToGithubPackagesRepository +## env: +## USERNAME: ${{ github.actor }} +## TOKEN: ${{ secrets.GITHUB_TOKEN }} +# +# - name: Publish to Maven Central +# run: ./gradlew publish From 25f5a092d710df631f535ab4827af6d0ffb01f85 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 16:15:53 +0800 Subject: [PATCH 12/15] ci: fix creating secret key ring file --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 7d390fa..02b7d9e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0-test-github-actions-5 +buildVersion=1.4.0-test-github-actions-6 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From 2d34b1dff53cf903b39f585e6d54b12cdb2191d8 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 16:18:17 +0800 Subject: [PATCH 13/15] ci: fixed cannot export a key ring file --- .github/workflows/github-packages-publish.yml | 70 ++++++++----------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index bdafb69..347edc3 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -33,46 +33,34 @@ jobs: passphrase: ${{ secrets.GPG_PASSPHRASE }} trust_level: 5 - - name: Check PGP Private Key - run: | - gpg --list-secret-keys --keyid-format LONG - - name: Creating PGP Ring Key - run: echo ${{ secrets.GPG_PASSPHRASE }} + run: echo ${{ secrets.GPG_PASSPHRASE }} | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --export-secret-keys -o gpg_key.ring -# - name: Restore gradle.properties -# env: -# GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} -# shell: bash -# run: | -# mkdir -p ~/.gradle/ -# echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle" -# echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties -# -# - name: Set up JDK 17 -# uses: actions/setup-java@v4 -# with: -# java-version: '17' -# distribution: 'corretto' -# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml -# settings-path: ${{ github.workspace }} # location for the settings.xml file -# -# - name: Setup Gradle -# uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 -# -# - name: Grant Execution Authority to Gradlew -# run: chmod +x ./gradlew -# -# - name: Build with Gradle -# run: ./gradlew build -# -# # The USERNAME and TOKEN need to correspond to the credentials environment variables used in -# # the publishing section of your build.gradle -## - name: Publish to GitHub Packages -## run: ./gradlew publishAllPublicationsToGithubPackagesRepository -## env: -## USERNAME: ${{ github.actor }} -## TOKEN: ${{ secrets.GITHUB_TOKEN }} -# -# - name: Publish to Maven Central -# run: ./gradlew publish + - name: Restore gradle.properties + env: + GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} + shell: bash + run: | + mkdir -p ~/.gradle/ + echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle" + echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'corretto' + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 + + - name: Grant Execution Authority to Gradlew + run: chmod +x ./gradlew + + - name: Build with Gradle + run: ./gradlew build + + - name: Publish to Maven Central + run: ./gradlew publish From 2ed7203b39dcbe8e65a43c70dbd5b0413eea7dda Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 16:18:59 +0800 Subject: [PATCH 14/15] ci: fixed cannot export a key ring file --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 02b7d9e..0ca2c11 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ springVersion=6.1.3 springBootVersion=3.2.3 buildGroupId=com.onixbyte -buildVersion=1.4.0-test-github-actions-6 +buildVersion=1.4.1 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 From 17cd46e6971c7fdad0e90d0ee1c50c5d5c0ec1f4 Mon Sep 17 00:00:00 2001 From: Zihlu Wang Date: Mon, 29 Apr 2024 16:26:07 +0800 Subject: [PATCH 15/15] ci: fixed cannot export a key ring file --- .github/workflows/github-packages-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-packages-publish.yml b/.github/workflows/github-packages-publish.yml index 347edc3..3ff4dcc 100644 --- a/.github/workflows/github-packages-publish.yml +++ b/.github/workflows/github-packages-publish.yml @@ -42,7 +42,7 @@ jobs: shell: bash run: | mkdir -p ~/.gradle/ - echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle" + export GRADLE_USER_HOME=~/.gradle echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties - name: Set up JDK 17