From ca3424cc25d7064dd952ec0c431c071b803a3191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Dywicki?= Date: Tue, 5 Mar 2024 00:17:23 +0100 Subject: [PATCH] Standardized cicd pipeline based on github workflows. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ɓukasz Dywicki --- .github/m2.yml | 66 -------------------------------- .github/r2.yml | 77 -------------------------------------- .github/workflows/push.yml | 1 + 3 files changed, 1 insertion(+), 143 deletions(-) delete mode 100644 .github/m2.yml delete mode 100644 .github/r2.yml diff --git a/.github/m2.yml b/.github/m2.yml deleted file mode 100644 index 9874b01..0000000 --- a/.github/m2.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Maven build - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - if: "!contains(github.event.commits[0].message, '[maven-release-plugin] prepare release')" - permissions: - checks: write - contents: read - strategy: - matrix: - java: [ 11 ] - os: [ ubuntu-latest ] - fail-fast: false - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: 'temurin' - - - name: Cache local Maven repository - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Build with Maven - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: >- - mvn -B -fae -nsu clean verify - org.sonarsource.scanner.maven:sonar-maven-plugin:sonar - -Dsonar.projectKey=ConnectorIO_plc4x-extras - -Dsonar.organization=connectorio - -Dsonar.host.url=https://sonarcloud.io - - name: Publish Test Report - if: success() || failure() - uses: scacap/action-surefire-report@v1 - - name: Upload Test Report - uses: actions/upload-artifact@v3 - if: success() || failure() - with: - name: "java-test-report-${{ matrix.os }}-java-${{ matrix.java }}" - path: | - **/surefire-reports/TEST-*.xml - **/failsafe-reports/TEST-*.xml - diff --git a/.github/r2.yml b/.github/r2.yml deleted file mode 100644 index 3299fe3..0000000 --- a/.github/r2.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Maven release - -on: - workflow_dispatch: - inputs: - releaseVersion: - description: "Release version." - required: true - default: "X.Y.Z" - developmentVersion: - description: "Version to which working copy should be set after release." - required: true - default: "X.Y.Z-SNAPSHOT" - dryRun: - description: "Should release be done in dry-run mode." - required: true - default: "true" - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - name: Setup git - run: | - git config user.email "ci@connectorio.com" - git config user.name "ConnectorIO Bot" - git config --global url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "git@github.com:" - env: - BUILD_USER: x-access-token - BUILD_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '11' - server-id: sonatype-nexus-staging - server-username: CI_RELEASE_USERNAME - server-password: CI_RELEASE_PASSWORD - gpg-passphrase: GPG_PASSPHRASE - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - - name: Cache local Maven repository - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Dump env - run: >- - env && cat ~/.m2/settings.xml - env: - CI_RELEASE_USERNAME: ${{ secrets.CI_RELEASE_USERNAME }} - CI_RELEASE_PASSWORD: ${{ secrets.CI_RELEASE_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - - name: Maven Prepare Release - run: >- - mvn -B - release:prepare -DpreparationProfiles=release - -DreleaseVersion=${{ inputs.releaseVersion }} - -DdevelopmentVersion=${{ inputs.developmentVersion }} - -DdryRun=${{ inputs.dryRun }} - - name: Maven Perform Release - if: success() - run: >- - mvn -B - release:perform -DreleaseProfiles=release - env: - CI_RELEASE_USERNAME: ${{ secrets.CI_RELEASE_USERNAME }} - CI_RELEASE_PASSWORD: ${{ secrets.CI_RELEASE_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - - name: Rollback on failure - if: failure() - run: | - mvn -B release:rollback - echo "You may need to manually delete the git tag, if it was created." \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 7924580..bb2eefd 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -6,6 +6,7 @@ on: jobs: build: + #if: ${{ true }} permissions: checks: write contents: read