diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5f8694..924effc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,33 +4,47 @@ on: push: tags: - 'v[0-9]+.[0-9]+.[0-9]+' + branches: + - fix-deploy-workflow jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - env: + GPG_KEY: ${{ secrets.GPG_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + run: | + echo $GPG_KEY | wc -c + echo $GPG_PASSPHRASE | wc -c + echo $NEXUS_USERNAME | wc -c + echo $NEXUS_PASSWORD | wc -c - name: Install Java and Maven uses: actions/setup-java@v1 with: java-version: 8 + server-id: release + server-username: ${{ secrets.NEXUS_USERNAME }} + server-password: ${{ secrets.NEXUS_USERNAME }} + gpg-private-key: ${{ secrets.GPG_KEY }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + - run: gpg --list-keys - name: Set release version run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV - - name: Create Release - id: create_release - uses: actions/create-release@v1.0.0 + - name: Publish to Apache Maven Central + run: mvn deploy env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ env.RELEASE_VERSION }} - draft: false - prerelease: false + MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_USERNAME }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Publish to Maven uses: samuelmeuli/action-maven-publish@v1 with: gpg_private_key: ${{ secrets.GPG_KEY }} gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} nexus_username: ${{ secrets.NEXUS_USERNAME }} - nexus_password: ${{ secrets.NEXUS_PASSWORD }} + nexus_password: ${{ secrets.NEXUS_USERNAME }} maven_profiles: release