Skip to content

Publish to Maven Central when a tag is pushed #129

Publish to Maven Central when a tag is pushed

Publish to Maven Central when a tag is pushed #129

Workflow file for this run

# 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: Java CI with Maven
on:
push:
branches: [master]
tags: ["**"]
pull_request:
branches: [master]
jobs:
build:
env:
SQUARE_ENVIRONMENT: sandbox
SQUARE_ACCESS_TOKEN: ${{ secrets.SQUARE_SANDBOX_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: "8"
distribution: "adopt"
- name: Build with Maven
run: mvn test -B

Check failure on line 29 in .github/workflows/maven.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/maven.yml

Invalid workflow file

You have an error in your yaml syntax on line 29
- name: Import signing key
if: ${{ github.ref_type == 'tag' }}
env:
SIGNING_KEY: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
run: |
# echo "-----BEGIN PGP PRIVATE KEY BLOCK-----" > key.txt
# echo "" >> key.txt
echo "$SIGNING_KEY" >> key.txt
# echo "-----END PGP PRIVATE KEY BLOCK-----" >> key.txt
gpg --import key.txt
- name: Release to Maven Central
if: ${{ github.ref_type == 'tag' }}
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
run: mvn package gpg:sign deploy --batch-mode --settings .maven_settings.xml
labeler:
needs: build
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: automerge-labeler
uses: fuxingloh/multi-labeler@v1
automerge:
needs: labeler
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: automerge
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: "automerge,automerge-branch,automerge-author"