Skip to content

Commit 12ffd65

Browse files
committed
Add quality workflow, build info, README
1 parent a114841 commit 12ffd65

File tree

7 files changed

+32
-8
lines changed

7 files changed

+32
-8
lines changed

.github/workflows/quality.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Quality
2+
3+
on: pull_request
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-java@v2
11+
with:
12+
distribution: microsoft
13+
java-version: 11
14+
cache: gradle
15+
- run: |
16+
set -x
17+
18+
./gradlew --no-daemon jar

.github/workflows/release.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ jobs:
2222
set -x
2323
2424
./gradlew --no-daemon jar distZip
25-
25+
2626
docker run \
2727
-v $(pwd)/build:/build \
2828
-w /build \
2929
-t ghcr.io/graalvm/native-image \
3030
--no-fallback \
31+
--enable-http \
3132
--enable-https \
3233
-jar "libs/kmspgp-$GITHUB_RELEASE_NAME.jar" \
33-
"kmspgp-$GITHUB_RELEASE_NAME-linux-amd64"
34-
34+
"kmspgp-$GITHUB_RELEASE_NAME-linux-amd64"
35+
3536
gh release upload "$GITHUB_RELEASE_NAME" \
3637
"build/distributions/kmspgp-$GITHUB_RELEASE_NAME.zip" \
3738
"build/libs/kmspgp-$GITHUB_RELEASE_NAME.jar" \
38-
"build/kmspgp-$GITHUB_RELEASE_NAME-linux-amd64"
39+
"build/kmspgp-$GITHUB_RELEASE_NAME-linux-amd64"

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# KMS for PGP/GPG
22

33
This tool allows you to use [AWS KMS][aws-kms] asymmetric keys as if they were
4-
PGP/GPG keys.
4+
PGP/GPG keys. (Only for signatures for now.)
55

66
This can be useful if you have CI/CD pipelines signing code or artifacts and
77
you don't wish to do all the hassle of proper cryptographic key management.
88

9+
It's also useful if you wish to use AWS CloudHSM keys via the KMS API for
10+
PGP/GPG operations.
11+
912
## How to use?
1013

1114
Download the latest release from the Github Releases page. Since this is a Java
@@ -49,7 +52,7 @@ project specify the following configuration:
4952

5053
```
5154
git config --local gpg.program <PATH-TO-KMSPGP>
52-
git config --local user.signingkey <KMS-KEY-ID>
55+
git config --local user.signingkey <KMS-KEY-ARN>
5356
git config --local commit.gpgsign true
5457
git config --local tag.forceSignAnnotated true
5558
```

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ task("generateBuildInfo") {
6565

6666
def fileWriter = new FileWriter(file)
6767

68-
fileWriter.write("object BuildInfo { val version = \"${determineVersion()}\" }")
68+
fileWriter.write("object BuildInfo {\n val version = \"${determineVersion()}\"\n val commit = \"${System.getenv("GITHUB_SHA") ?: "<snapshot>"}\"\n}")
6969
fileWriter.flush()
7070
fileWriter.close()
7171
}

src/main/kotlin/me/stojan/kmspgp/cli/CLI.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import com.github.ajalt.clikt.core.subcommands
55

66
object CLI {
77
val version = BuildInfo.version
8+
val commit = BuildInfo.commit
89

910
fun run(args: Array<String>) = Root()
1011
.run {

src/main/kotlin/me/stojan/kmspgp/cli/Version.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ import com.github.ajalt.clikt.core.CliktCommand
55
class Version(val root: Root) : CliktCommand(help = "Get the version.") {
66
override fun run() {
77
echo(message = "Version: ${CLI.version}")
8+
echo(message = "Commit: ${CLI.commit}")
89
}
910
}

src/main/kotlin/me/stojan/kmspgp/crypto/PGP.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object PGP {
4040
throw UnsupportedOperationException("ECDSA public key of type '${pubRes.customerMasterKeySpecAsString()}' has SubjectPublicKeyInfo which does not start with 0x04, see https://datatracker.ietf.org/doc/html/rfc5480#section-2.2")
4141
}
4242

43-
BigInteger(this, 1, size - 1)
43+
BigInteger(this)
4444
}
4545
)
4646

0 commit comments

Comments
 (0)