From da52e95be3c70de61cddc409b4cb9c0430465e48 Mon Sep 17 00:00:00 2001 From: "Petri, Matthias" Date: Tue, 4 Apr 2023 13:15:34 +0200 Subject: [PATCH] Added GitHub Action to build and release --- .github/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ab8c86a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy artifacts with Maven +on: + push: + branches: [main] + release: + types: [published] +jobs: + publish: + runs-on: ubuntu-20.04 + steps: + - name: Checks out code + uses: actions/checkout@v3 + + - name: Set up Java environment + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: zulu + cache: maven + gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_SEC }} + gpg-passphrase: MAVEN_CENTRAL_GPG_PASSPHRASE + + - name: Deploy SNAPSHOT / Release + uses: camunda-community-hub/community-action-maven-release@v1 + with: + release-version: ${{ github.event.release.tag_name }} + nexus-usr: ${{ secrets.NEXUS_USR }} + nexus-psw: ${{ secrets.NEXUS_PSW }} + maven-usr: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_USR }} + maven-psw: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_PSW }} + maven-url: oss.sonatype.org + maven-gpg-passphrase: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_PASSPHRASE }} + maven-auto-release-after-close: true + github-token: ${{ secrets.GITHUB_TOKEN }} + id: release + + - if: github.event.release + name: Attach artifacts to GitHub Release (Release only) + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.release.outputs.artifacts_archive_path }} + asset_name: ${{ steps.release.outputs.artifacts_archive_path }} + asset_content_type: application/zip \ No newline at end of file