Skip to content

Commit 2d34b1d

Browse files
committed
ci: fixed cannot export a key ring file
1 parent 25f5a09 commit 2d34b1d

File tree

1 file changed

+28
-40
lines changed

1 file changed

+28
-40
lines changed

.github/workflows/github-packages-publish.yml

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,46 +33,34 @@ jobs:
3333
passphrase: ${{ secrets.GPG_PASSPHRASE }}
3434
trust_level: 5
3535

36-
- name: Check PGP Private Key
36+
- name: Creating PGP Ring Key
37+
run: echo ${{ secrets.GPG_PASSPHRASE }} | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --export-secret-keys -o gpg_key.ring
38+
39+
- name: Restore gradle.properties
40+
env:
41+
GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }}
42+
shell: bash
3743
run: |
38-
gpg --list-secret-keys --keyid-format LONG
44+
mkdir -p ~/.gradle/
45+
echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle"
46+
echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties
3947
40-
- name: Creating PGP Ring Key
41-
run: echo ${{ secrets.GPG_PASSPHRASE }}
48+
- name: Set up JDK 17
49+
uses: actions/setup-java@v4
50+
with:
51+
java-version: '17'
52+
distribution: 'corretto'
53+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
54+
settings-path: ${{ github.workspace }} # location for the settings.xml file
55+
56+
- name: Setup Gradle
57+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
58+
59+
- name: Grant Execution Authority to Gradlew
60+
run: chmod +x ./gradlew
61+
62+
- name: Build with Gradle
63+
run: ./gradlew build
4264

43-
# - name: Restore gradle.properties
44-
# env:
45-
# GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }}
46-
# shell: bash
47-
# run: |
48-
# mkdir -p ~/.gradle/
49-
# echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle"
50-
# echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties
51-
#
52-
# - name: Set up JDK 17
53-
# uses: actions/setup-java@v4
54-
# with:
55-
# java-version: '17'
56-
# distribution: 'corretto'
57-
# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
58-
# settings-path: ${{ github.workspace }} # location for the settings.xml file
59-
#
60-
# - name: Setup Gradle
61-
# uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
62-
#
63-
# - name: Grant Execution Authority to Gradlew
64-
# run: chmod +x ./gradlew
65-
#
66-
# - name: Build with Gradle
67-
# run: ./gradlew build
68-
#
69-
# # The USERNAME and TOKEN need to correspond to the credentials environment variables used in
70-
# # the publishing section of your build.gradle
71-
## - name: Publish to GitHub Packages
72-
## run: ./gradlew publishAllPublicationsToGithubPackagesRepository
73-
## env:
74-
## USERNAME: ${{ github.actor }}
75-
## TOKEN: ${{ secrets.GITHUB_TOKEN }}
76-
#
77-
# - name: Publish to Maven Central
78-
# run: ./gradlew publish
65+
- name: Publish to Maven Central
66+
run: ./gradlew publish

0 commit comments

Comments
 (0)