From 93baea2c08e65016d43b3bdd756441cc83593da2 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Thu, 13 Oct 2022 15:37:37 +0100 Subject: [PATCH] Use the xoom-platform build workflow Signed-off-by: Jakub Zalas --- .github/workflows/build.yml | 144 +----------------------------------- 1 file changed, 3 insertions(+), 141 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e311124a..1787d6ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,144 +11,6 @@ env: jobs: build: - name: Build - runs-on: ubuntu-latest - timeout-minutes: 15 - outputs: - xoom_version: ${{ steps.version.outputs.xoom_version }} - - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2- - - - name: Determine version - id: version - run: echo "::set-output name=xoom_version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" - - - name: Build with Maven - run: mvn --batch-mode --update-snapshots -Pgithub-releases install - - - name: Publish artifacts - uses: actions/upload-artifact@v2 - with: - name: JARs - path: target/*.jar - - - name: Notify slack - if: always() && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository_owner == 'vlingo' - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: ci-cd - SLACK_USERNAME: Bob the Builder - SLACK_ICON: 'https://vlingo.io/wp-content/uploads/cropped-vlingo-favicon-180x180.png' - SLACK_FOOTER: '${{ github.repository }}:${{ steps.version.outputs.xoom_version }}' - - deploy-github: - name: Deploy to GitHub - runs-on: ubuntu-latest - needs: build - if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && github.repository_owner == 'vlingo' - steps: - - - uses: actions/checkout@v2 - - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2- - - - name: Deploy - run: mvn --batch-mode -DskipTests -DuseGitHubPackages -DsignArtifacts -Pgithub-releases deploy - env: - GITHUB_TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - - name: Notify slack - if: failure() - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: ci-cd - SLACK_USERNAME: Suzi the Publisher - SLACK_ICON: 'https://vlingo.io/wp-content/uploads/cropped-vlingo-favicon-180x180.png' - SLACK_FOOTER: '${{ github.repository }}' - SLACK_TITLE: 'GitHub Deployment' - SLACK_MESSAGE: ':rocket: ${{ needs.build.outputs.xoom_version }}' - - deploy-central: - name: Deploy to Maven Central - runs-on: ubuntu-latest - needs: build - if: (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && github.repository_owner == 'vlingo' - steps: - - - uses: actions/checkout@v2 - - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - server-id: central-repository-ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Configure an additional Maven repository - run: sed -i'.bkp' -e 's/\(<\/servers>\)/ github<\/id>\${env.GITHUB_ACTOR}<\/username>\${env.GITHUB_TOKEN}<\/password><\/server>\n\1/g' ~/.m2/settings.xml - - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2- - - - name: Deploy - run: mvn --batch-mode -DskipTests -DuseSonatype -DsignArtifacts -Pgithub-releases deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - - name: Trigger downstream builds - if: startsWith(github.ref, 'refs/tags/') - run: .github/trigger_deps.sh - env: - RELEASE_GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} - - - name: Notify slack - if: startsWith(github.ref, 'refs/tags/') || failure() - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: ci-cd - SLACK_USERNAME: Suzi the Publisher - SLACK_ICON: 'https://vlingo.io/wp-content/uploads/cropped-vlingo-favicon-180x180.png' - SLACK_FOOTER: '${{ github.repository }}' - SLACK_TITLE: 'Sonatype Deployment' - SLACK_MESSAGE: ':rocket: ${{ needs.build.outputs.xoom_version }}' + name: Build and Deploy + uses: vlingo/xoom-platform/.github/workflows/build.yml@master + secrets: inherit