Skip to content

Commit

Permalink
🐛 :: (#2) GPG Signing step 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
smoothbear committed May 27, 2021
1 parent ddec5db commit 49d4e82
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .github/commands/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
set -euo pipefail
IFS=$'\n\t'

function cleanup {
echo "🧹 Cleanup..."
rm -f gradle.properties golo-dev-sign.asc
}

trap cleanup SIGINT SIGTERM ERR EXIT

echo "🚀 Preparing to deploy..."

echo "🔑 Decrypting files..."

gpg --quiet --batch --yes --decrypt --passphrase="${GPG_SECRET}" \
--output golo-dev-sign.asc .build/golo-dev-sign.asc.gpg

gpg --quiet --batch --yes --decrypt --passphrase="${GPG_SECRET}" \
--output gradle.properties .build/gradle.properties.gpg

gpg --fast-import --no-tty --batch --yes golo-dev-sign.asc

echo "📦 Publishing..."

gradle publish

echo "✅ Done!"
27 changes: 27 additions & 0 deletions .github/workflows/commands/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
set -euo pipefail
IFS=$'\n\t'

function cleanup {
echo "🧹 Cleanup..."
rm -f gradle.properties golo-dev-sign.asc
}

trap cleanup SIGINT SIGTERM ERR EXIT

echo "🚀 Preparing to deploy..."

echo "🔑 Decrypting files..."

gpg --quiet --batch --yes --decrypt --passphrase="${GPG_SECRET}" \
--output smoothbear04-sign.asc .github/workflows/commands/gpg/smoothbear04-sign.asc.gpg

gpg --quiet --batch --yes --decrypt --passphrase="${GPG_SECRET}" \
--output gradle.properties .github/workflows/commands/gpg/gradle.properties.gpg

gpg --fast-import --no-tty --batch --yes .github/workflows/commands/gpg/smoothbear04-sign.asc

echo "📦 Publishing..."

gradle publish

echo "✅ Done!"
Binary file added .github/workflows/commands/gpg/gradle.properties.gpg
Binary file not shown.
Binary file not shown.
9 changes: 8 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ jobs:
with:
java-version: '11'
distribution: 'adopt'
- name: Configure GPG Key
run: |
mkdir -p ~/.gnupg/
printf "$GPG_SIGNING_KEY" | base64 --decode > ~/.gnupg/private.key
gpg --import ~/.gnupg/private.key
env:
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
- name: Build packages
run: gradle build
- name: Publish to the Maven Central Repository
run: gradle publish --info
run: .github/commands/deploy.sh
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Gradle
.gradle
gradle.properties

# IDE Settings
.idea
Expand Down
32 changes: 29 additions & 3 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group 'io.github.team-xquare'
version '0.0.9'
version '0.0.10'

repositories {
mavenCentral()
Expand Down Expand Up @@ -40,15 +40,41 @@ task sourcesJar(type: Jar) {
publishing {
publications {
maven(MavenPublication) {
groupId = 'io.github.team-xquare'
artifactId = 'utils'
version = '0.0.9'

from components.java
artifact sourcesJar
artifact javadocJar

pom {
name = 'Xquare Utils'
description = 'Supporting to develop xquare'
url = 'https://github.com/team-xquare/java-utils'

licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}

developers {
developer {
id = 'smoothbear'
name = 'Jungbin Kim'
email = 'smoothbear04@gmail.com'
}
}

scm {
connection = 'scm:svn:http://foo.googlecode.com/svn/trunk/'
developerConnection = 'scm:svn:https://foo.googlecode.com/svn/trunk/'
url = 'http://foo.googlecode.com/svn/trunk/'
}
}
}
}

repositories {
maven {
name = "OSSRH"
Expand Down

0 comments on commit 49d4e82

Please sign in to comment.