Skip to content

Commit

Permalink
Try GPG signing
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Sep 24, 2021
1 parent 60487e3 commit 27e212b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 30 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: jars
path: 'target/*.jar'
- if: startsWith(${{ github.ref }}, 'refs/tags/')
run: python3 ./script/deploy.py --ref ${{ github.ref }}
path: |
target/*.jar
target/maven/META-INF/maven/io.github.humbleui.jwm/jwm/pom.xml
- name: Deploy to Maven Central
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
python3 ./script/deploy.py --ref ${{ github.ref }}
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
# if: startsWith(${{ github.ref }}, 'refs/tags/')

63 changes: 36 additions & 27 deletions script/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,40 @@ def main():
parser.add_argument('--ref', required=True)
(args, _) = parser.parse_known_args()

print('Deploying jwm-shared-' + rev + ".jar")
subprocess.check_call([
common.mvn,
'--batch-mode',
'--settings', 'deploy/settings.xml',
'-Dspace.username=Nikita.Prokopov',
'-Dspace.password=' + os.getenv('SPACE_TOKEN'),
'deploy:deploy-file',
"-Dfile=target/jwm-shared-" + rev + ".jar",
"-DpomFile=deploy/META-INF/maven/io.github.humbleui.jwm/jwm-shared/pom.xml",
"-DrepositoryId=space-maven",
"-Durl=" + common.space_jwm,
])
for path in glob.glob("target/*.jar") + ["target/maven/META-INF/maven/io.github.humbleui.jwm/jwm/pom.xml"]:
subprocess.check_call(["gpg",
"--armor",
"--detach-sign",
"--batch",
"--yes",
path
])

print('Deploying jwm-shared-' + rev + "-sources.jar")
subprocess.check_call([
common.mvn,
'--batch-mode',
'--settings', 'deploy/settings.xml',
'-Dspace.username=Nikita.Prokopov',
'-Dspace.password=' + os.getenv('SPACE_TOKEN'),
'deploy:deploy-file',
"-Dpackaging=java-source",
"-Dfile=target/jwm-shared-" + rev + "-sources.jar",
"-DpomFile=deploy/META-INF/maven/io.github.humbleui.jwm/jwm-shared/pom.xml",
"-DrepositoryId=space-maven",
"-Durl=" + common.space_jwm,
])
# print('Deploying jwm-shared-' + rev + ".jar")
# subprocess.check_call([
# common.mvn,
# '--batch-mode',
# '--settings', 'deploy/settings.xml',
# '-Dspace.username=Nikita.Prokopov',
# '-Dspace.password=' + os.getenv('SPACE_TOKEN'),
# 'deploy:deploy-file',
# "-Dfile=target/jwm-shared-" + rev + ".jar",
# "-DpomFile=deploy/META-INF/maven/io.github.humbleui.jwm/jwm-shared/pom.xml",
# "-DrepositoryId=space-maven",
# "-Durl=" + common.space_jwm,
# ])

# print('Deploying jwm-shared-' + rev + "-sources.jar")
# subprocess.check_call([
# common.mvn,
# '--batch-mode',
# '--settings', 'deploy/settings.xml',
# '-Dspace.username=Nikita.Prokopov',
# '-Dspace.password=' + os.getenv('SPACE_TOKEN'),
# 'deploy:deploy-file',
# "-Dpackaging=java-source",
# "-Dfile=target/jwm-shared-" + rev + "-sources.jar",
# "-DpomFile=deploy/META-INF/maven/io.github.humbleui.jwm/jwm-shared/pom.xml",
# "-DrepositoryId=space-maven",
# "-Durl=" + common.space_jwm,
# ])

0 comments on commit 27e212b

Please sign in to comment.