chore: 版本升级,v1.0.3 #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: deploy devops-scm jar to maven repository | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Set up GPG | |
run: | | |
echo ${{ github.workspace }} | |
# gpg init | |
mkdir ~/.gnupg && echo use-agent >> ~/.gnupg/gpg.conf | |
echo pinentry-mode loopback >> ~/.gnupg/gpg.conf | |
echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf | |
echo RELOADAGENT | gpg-connect-agent | |
echo ${SIGNING_KEY} | awk '{gsub(/\\n/,"\n")}1'| gpg --dearmor > ${{ github.workspace }}/secretKeyRingFile.gpg | |
gpg --import --pinentry-mode loopback --batch --passphrase '${SIGNING_PASSWORD}' ${{ github.workspace }}/secretKeyRingFile.gpg | |
ls -al ${{ github.workspace }} | |
ls -al ~/.gnupg/ | |
env: | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
- name: Gradle Build | |
env: | |
build_mavenRepoDeployUrl: "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | |
build_mavenRepoUsername: ${{ secrets.SONATYPE_USERNAME }} | |
build_mavenRepoPassword: ${{ secrets.SONATYPE_PASSWORD }} | |
run: | | |
echo "GITHUB_REF=${GITHUB_REF}" | |
chmod +x ./gradlew | |
./gradlew clean publish \ | |
-Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} \ | |
-Psigning.password='${{ secrets.SIGNING_PASSWORD }}' \ | |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secretKeyRingFile.gpg | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1.12.0 | |
with: | |
name: "${{ github.ref_name }}" | |
draft: true | |
prerelease: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: "See <a href='https://github.com/bkdevops-projects/devops-scm/blob/master/CHANGELOG.md'>the CHANGELOG</a> for more details." | |
- name: Clean Up | |
if: ${{ always() }} | |
run: | | |
rm -rf ~/.gnupg |