diff --git a/.github/workflows/auto-merge-dependabot-pr.yml b/.github/workflows/auto-merge-dependabot-pr.yml deleted file mode 100644 index d34678fe..00000000 --- a/.github/workflows/auto-merge-dependabot-pr.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Dependabot auto-merge -on: - pull_request: - types: - - opened - - synchronize - -jobs: - tests: - uses: ./.github/workflows/test.yml - secrets: inherit - permissions: - contents: read - - dependabot: - if: ${{ github.actor == 'dependabot[bot]' }} - name: Auto-merge Dependabot PR - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - needs: tests - permissions: - contents: write - pull-requests: write - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Enable auto-merge for Dependabot PRs - # (fixes, features but not major upgrades!) - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}} - run: gh pr merge --auto -d -r "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{ secrets.RTLDEV_MW_CI_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 499e9f07..3020ee1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,61 +5,8 @@ on: - master jobs: - build: - name: Build - uses: ./.github/workflows/test.yml - permissions: - contents: read - packages: write - release: - name: Release - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - needs: build - permissions: - contents: write - issues: write - deployments: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - uses: actions/setup-java@v4 - with: - java-version: ${{ vars.RTLDEV_MW_CI_JAVA_VERSION }} - distribution: ${{ vars.RTLDEV_MW_CI_JAVA_DISTRO }} - - name: Setup NodeJS ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ vars.RTLDEV_MW_CI_NODE_VERSION }} - check-latest: true - cache: "npm" - - name: Download Artifacts - uses: actions/download-artifact@v3 - id: download - with: - name: coverage - - run: | - rm -rf target - unzip -qq -o target.zip - rm target.zip - - name: Install dependencies - run: npm ci - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.RTLDEV_MW_CI_TOKEN }} - MAVEN_OPTS: ${{ vars.MAVEN_OPTS }} - OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} - OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} - ENCRYPTED_C9F9AEDF26B7_KEY: ${{ secrets.ENCRYPTED_C9F9AEDF26B7_KEY }} - ENCRYPTED_C9F9AEDF26B7_IV: ${{ secrets.ENCRYPTED_C9F9AEDF26B7_IV }} - GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - TEAMS_NOTIFICATION_URI: ${{ secrets.RTLDEV_MW_CI_NOTIFICATION_URI }} - COMMIT_SHA: ${{ github.sha }} - run: | - openssl aes-256-cbc -K $ENCRYPTED_C9F9AEDF26B7_KEY -iv $ENCRYPTED_C9F9AEDF26B7_IV -in codesigning.asc.enc -out codesigning.asc -d - gpg --import --batch codesigning.asc - npx semantic-release \ No newline at end of file + uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/release.yml + secrets: inherit + with: + requestedFrom: java-sdk \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20092b6b..2f54426e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,57 +1,12 @@ -name: Test - +name: Dependabot auto-merge & tests on: - workflow_call: + pull_request: + types: + - opened + - synchronize jobs: - lint: - name: 🧪 Linting - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - permissions: - contents: read - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - name: Super Linter Code Base - uses: github/super-linter/slim@v5 - env: - FILTER_REGEX_INCLUDE: "((/src/main/.*.java)|updateVersion.sh)" - DEFAULT_BRANCH: master - VALIDATE_JAVA: true - VALIDATE_BASH: true - VALIDATE_ALL_CODEBASE: false - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - test_matrix: - name: 🧪 Testing - runs-on: ${{ vars.RTLDEV_MW_CI_OS }} - needs: lint - permissions: - contents: read - strategy: - matrix: - java-version: ${{ fromJson(vars.RTLDEV_MW_CI_JAVA_MATRIX) }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - name: Java JDK @^${{ matrix.java-version }} - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java-version }} - distribution: ${{ vars.RTLDEV_MW_CI_JAVA_DISTRO }} - - name: Validate & Coverage Report - run: | - mvn -B clean site package - zip -r /home/runner/target.zip ./target - - uses: actions/upload-artifact@v3 - id: upload - with: - name: coverage - path: ~/target.zip - retention-days: 1 + tests: + uses: centralnicgroup-opensource/rtldev-middleware-shareable-workflows/.github/workflows/auto-merge-dependabot-pr.yml + with: + requestedFrom: java-sdk \ No newline at end of file