From 34d7c616f1bf357410d2c62b9e5f472e1d36b51f Mon Sep 17 00:00:00 2001 From: Jarkko Jaakola Date: Mon, 12 Aug 2024 11:26:12 +0300 Subject: [PATCH] chore: move .github directory to root Combine the GCS and S3 connector .github directory and move to root. The workflows will not get picked up by Github. --- {gcs-connector/.github => .github}/CODEOWNERS | 0 .../.github => .github}/dependabot.yml | 0 .../workflows/codeql-analysis.yml | 13 +-- .../workflows/create_release.yml | 6 +- .../main_push_and_pull_request_workflow.yml | 4 +- .../workflows/main_push_workflow.yml | 4 +- .../workflows/release_pr_workflow.yml | 2 +- .../.github/workflows/codeql-analysis.yml | 81 ------------------- .../main_push_and_pull_request_workflow.yml | 26 ------ .../.github/workflows/release_pr_workflow.yml | 63 --------------- s3-connector/.github/CODEOWNERS | 1 - s3-connector/.github/dependabot.yml | 6 -- .../.github/workflows/create_release.yml | 76 ----------------- 13 files changed, 16 insertions(+), 266 deletions(-) rename {gcs-connector/.github => .github}/CODEOWNERS (100%) rename {gcs-connector/.github => .github}/dependabot.yml (100%) rename {s3-connector/.github => .github}/workflows/codeql-analysis.yml (91%) rename {gcs-connector/.github => .github}/workflows/create_release.yml (96%) rename {s3-connector/.github => .github}/workflows/main_push_and_pull_request_workflow.yml (89%) rename {s3-connector/.github => .github}/workflows/main_push_workflow.yml (93%) rename {s3-connector/.github => .github}/workflows/release_pr_workflow.yml (98%) delete mode 100644 gcs-connector/.github/workflows/codeql-analysis.yml delete mode 100644 gcs-connector/.github/workflows/main_push_and_pull_request_workflow.yml delete mode 100644 gcs-connector/.github/workflows/release_pr_workflow.yml delete mode 100644 s3-connector/.github/CODEOWNERS delete mode 100644 s3-connector/.github/dependabot.yml delete mode 100644 s3-connector/.github/workflows/create_release.yml diff --git a/gcs-connector/.github/CODEOWNERS b/.github/CODEOWNERS similarity index 100% rename from gcs-connector/.github/CODEOWNERS rename to .github/CODEOWNERS diff --git a/gcs-connector/.github/dependabot.yml b/.github/dependabot.yml similarity index 100% rename from gcs-connector/.github/dependabot.yml rename to .github/dependabot.yml diff --git a/s3-connector/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml similarity index 91% rename from s3-connector/.github/workflows/codeql-analysis.yml rename to .github/workflows/codeql-analysis.yml index 3c50b708a..be7c5fd93 100644 --- a/s3-connector/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [ main ] + branches: [main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main] schedule: - cron: "42 20 * * 6" @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -68,12 +68,13 @@ jobs: # make bootstrap # make release - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 + distribution: temurin - name: Build with Gradle run: ./gradlew build - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2.3.5 diff --git a/gcs-connector/.github/workflows/create_release.yml b/.github/workflows/create_release.yml similarity index 96% rename from gcs-connector/.github/workflows/create_release.yml rename to .github/workflows/create_release.yml index 624578470..efea67124 100644 --- a/gcs-connector/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -16,15 +16,17 @@ jobs: build: name: Create Release runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Setup Java SDK - uses: actions/setup-java@v3.11.0 + uses: actions/setup-java@v4 with: java-version: 11 distribution: 'temurin' - name: Checkout code - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.commit_hash }} diff --git a/s3-connector/.github/workflows/main_push_and_pull_request_workflow.yml b/.github/workflows/main_push_and_pull_request_workflow.yml similarity index 89% rename from s3-connector/.github/workflows/main_push_and_pull_request_workflow.yml rename to .github/workflows/main_push_and_pull_request_workflow.yml index 90a0555f3..ad3c895c9 100644 --- a/s3-connector/.github/workflows/main_push_and_pull_request_workflow.yml +++ b/.github/workflows/main_push_and_pull_request_workflow.yml @@ -15,9 +15,9 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - name: Checkout code - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3.11.0 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java-version }} distribution: "temurin" diff --git a/s3-connector/.github/workflows/main_push_workflow.yml b/.github/workflows/main_push_workflow.yml similarity index 93% rename from s3-connector/.github/workflows/main_push_workflow.yml rename to .github/workflows/main_push_workflow.yml index 23bb694c2..7db41ce21 100644 --- a/s3-connector/.github/workflows/main_push_workflow.yml +++ b/.github/workflows/main_push_workflow.yml @@ -15,9 +15,9 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java-version }} distribution: "temurin" diff --git a/s3-connector/.github/workflows/release_pr_workflow.yml b/.github/workflows/release_pr_workflow.yml similarity index 98% rename from s3-connector/.github/workflows/release_pr_workflow.yml rename to .github/workflows/release_pr_workflow.yml index 4714e5084..025711882 100644 --- a/s3-connector/.github/workflows/release_pr_workflow.yml +++ b/.github/workflows/release_pr_workflow.yml @@ -34,7 +34,7 @@ jobs: fi - name: Checkout main - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: main fetch-depth: 0 diff --git a/gcs-connector/.github/workflows/codeql-analysis.yml b/gcs-connector/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 7e06365ac..000000000 --- a/gcs-connector/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,81 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [main] - pull_request: - # The branches below must be a subset of the branches above - branches: [main] - schedule: - - cron: "42 20 * * 6" - -permissions: - actions: read - contents: read - security-events: write - - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: ["java"] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v3.5.2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2.3.5 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - #- name: Autobuild - # uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - name: Set up JDK 11 - uses: actions/setup-java@v3.11.0 - with: - java-version: 11 - distribution: temurin - - - name: Build with Gradle - run: ./gradlew build - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2.3.5 diff --git a/gcs-connector/.github/workflows/main_push_and_pull_request_workflow.yml b/gcs-connector/.github/workflows/main_push_and_pull_request_workflow.yml deleted file mode 100644 index 90a0555f3..000000000 --- a/gcs-connector/.github/workflows/main_push_and_pull_request_workflow.yml +++ /dev/null @@ -1,26 +0,0 @@ -# The workflow to check main after push or pull request. -name: main and pull request checks -on: - push: - branches: [main] - pull_request: - branches: [main] -jobs: - build: - strategy: - matrix: - java-version: [11, 17] - runs-on: [ubuntu-latest] - name: Build on ${{ matrix.runs-on }} with jdk ${{ matrix.java-version }} - runs-on: ${{ matrix.runs-on }} - steps: - - name: Checkout code - uses: actions/checkout@v3.5.2 - - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3.11.0 - with: - java-version: ${{ matrix.java-version }} - distribution: "temurin" - cache: gradle - - name: Build with Gradle - run: ./gradlew build integrationTest diff --git a/gcs-connector/.github/workflows/release_pr_workflow.yml b/gcs-connector/.github/workflows/release_pr_workflow.yml deleted file mode 100644 index b62865c76..000000000 --- a/gcs-connector/.github/workflows/release_pr_workflow.yml +++ /dev/null @@ -1,63 +0,0 @@ -# The workflow to create PRs with release commits. -name: Create release PR -on: - workflow_dispatch: - inputs: - release_version: - description: "Release version '0.1.2' (without 'v')" - required: true - snapshot_version: - description: "Snapshot version '0.2.0-SNAPSHOT' (without 'v')" - required: true - -permissions: - contents: write - pull-requests: write - issues: write - -jobs: - create_release_pr: - name: Create release PR (job) - runs-on: ubuntu-latest - steps: - - name: Check versions - run: | - echo "Checking release version..." - if echo ${{ github.event.inputs.release_version }} | grep --invert-match '^[0-9]\+\.[0-9]\+\.[0-9]\+$' > /dev/null; then - echo "Release version is invalid" - exit 1 - fi - - echo "Checking snapshot version..." - if echo ${{ github.event.inputs.snapshot_version }} | grep --invert-match '^[0-9]\+\.[0-9]\+\.[0-9]\+-SNAPSHOT$' > /dev/null; then - echo "Snapshot version is invalid" - exit 1 - fi - - - name: Checkout main - uses: actions/checkout@v3.5.2 - with: - ref: main - fetch-depth: 0 - - - name: Create release commits - run: | - git config --local user.name "GitHub Action" - git config --local user.email "action@github.com" - sed -i -e "s/^version=.\+$/version=${{ github.event.inputs.release_version }}/g" gradle.properties - git add gradle.properties - git commit -m "Release version ${{ github.event.inputs.release_version }}" - sed -i -e "s/^version=.\+$/version=${{ github.event.inputs.snapshot_version }}/g" gradle.properties - git add gradle.properties - git commit -m "Bump version to ${{ github.event.inputs.snapshot_version }}" - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - branch: release-${{ github.event.inputs.release_version }} - delete-branch: true - draft: true - title: Release version ${{ github.event.inputs.release_version }} - body: | - Proposed changelog: - - *fill in* diff --git a/s3-connector/.github/CODEOWNERS b/s3-connector/.github/CODEOWNERS deleted file mode 100644 index 92c10a990..000000000 --- a/s3-connector/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @aiven-open/team-helpful-husky @aiven-open/aiven-open-source diff --git a/s3-connector/.github/dependabot.yml b/s3-connector/.github/dependabot.yml deleted file mode 100644 index dfa800a18..000000000 --- a/s3-connector/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "gradle" - directory: "/" - schedule: - interval: "monthly" diff --git a/s3-connector/.github/workflows/create_release.yml b/s3-connector/.github/workflows/create_release.yml deleted file mode 100644 index ef7e6a3cd..000000000 --- a/s3-connector/.github/workflows/create_release.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Create release - -on: - workflow_dispatch: - inputs: - commit_hash: - description: "Hash of 'Release version x.y.z' commit" - required: true - -permissions: - contents: write - pull-requests: write - issues: write - -jobs: - build: - name: Create Release - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Setup Java SDK - uses: actions/setup-java@v1.4.3 - with: - java-version: 11 - - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.event.inputs.commit_hash }} - - - name: Check commit title and extract version - run: | - export commit_title=$(git log --pretty=format:%s -1 ${{ github.event.inputs.commit_hash }}) - echo "Commit title: $commit_title" - if [[ $commit_title =~ ^Release\ version\ [0-9]*\.[0-9]*\.[0-9]*$ ]]; then - echo "Valid commit title" - else - echo "Invalid commit title" - exit 1 - fi - export version=$(echo ${commit_title} | sed s/^Release\ version\ //g) - echo "Will use version ${version}" - echo "version=${version}" >> $GITHUB_ENV - - - name: Build - run: | - ./gradlew clean build - - - name: Create tag - run: | - git config --local user.name "GitHub Action" - git config --local user.email "action@github.com" - git tag -a "v${{ env.version }}" -m "Release version ${{ env.version }}" - git push origin "v${{ env.version }}" - - - name: Create tag - run: | - git config --local user.name "GitHub Action" - git config --local user.email "action@github.com" - git tag -a "v${{ env.version }}" -m "Release version ${{ env.version }}" - git push origin "v${{ env.version }}" - - - name: Create release draft - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: "v${{ env.version }}" - release_name: "v${{ env.version }}" - commitish: ${{ github.event.inputs.commit_hash }} - body: | - *Fill in* - draft: true - prerelease: false