From 3bc1a87e9c9fe7af3dd4fcb93e09251b812ed7f9 Mon Sep 17 00:00:00 2001 From: Zvonimir Ilic Date: Fri, 17 Feb 2023 16:10:06 +0100 Subject: [PATCH] feat(RA-1760): initial release --- .github/workflows/main_and_pr_workflow.yml | 27 ++++++++++++------- .releaserc | 20 ++++++++++++++ .../create_release.yml | 0 ...pr_workflow.yml => release_pr_workflow.yml | 0 4 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 .releaserc rename {.github/workflows => legacy_workflows}/create_release.yml (100%) rename .github/workflows/release_pr_workflow.yml => release_pr_workflow.yml (100%) diff --git a/.github/workflows/main_and_pr_workflow.yml b/.github/workflows/main_and_pr_workflow.yml index d5037e55..6de20ca4 100644 --- a/.github/workflows/main_and_pr_workflow.yml +++ b/.github/workflows/main_and_pr_workflow.yml @@ -1,19 +1,19 @@ name: Gradle on: push: - branches: [ main ] - pull_request: - branches: [ main ] + branches: + - main + - beta jobs: check: strategy: matrix: entry: - - { opensearch-version: 1.3.6, java-version: 11 } - - { opensearch-version: 1.3.6, java-version: 17 } + # - { opensearch-version: 1.3.6, java-version: 11 } + # - { opensearch-version: 1.3.6, java-version: 17 } - { opensearch-version: 1.3.6, java-version: 19 } - - { opensearch-version: 2.3.0, java-version: 11 } - - { opensearch-version: 2.3.0, java-version: 17 } + # - { opensearch-version: 2.3.0, java-version: 11 } + # - { opensearch-version: 2.3.0, java-version: 17 } - { opensearch-version: 2.3.0, java-version: 19 } runs-on: [ubuntu-latest] name: Check on ${{ matrix.runs-on }} (JDK-${{ matrix.entry.java-version }}, OpenSearch ${{ matrix.entry.opensearch-version }}) @@ -33,13 +33,18 @@ jobs: build: strategy: matrix: - java-version: [ 11, 17, 19 ] - runs-on: [ubuntu-latest, macos-latest, windows-latest] + java-version: [ 19 ] + 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 + - name: Setup Node.js and semantic-release plugins + uses: actions/setup-node@v1 + with: + node-version: 18.14.0 + - run: npm install -g semantic-release@18.0.1 @semantic-release/github@8.0.4 @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/exec semantic-release/git semantic-release/release-notes-generator - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v3 with: @@ -47,5 +52,7 @@ jobs: distribution: 'temurin' cache: gradle - name: Build with Gradle - run: ./gradlew build -x integrationTest + run: npx semantic-release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 00000000..6cde75b0 --- /dev/null +++ b/.releaserc @@ -0,0 +1,20 @@ +{ + "repositoryUrl": "https://github.com/superbet-group/opensearch-connector-for-apache-kafka", + "branches": [ + { "name": "main" }, + { "name": "beta", "channel": "beta", "prerelease": true }, + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + ["@semantic-release/github", { + "assets": [ + {"path": "build/distributions/*.zip"}, + {"path": "build/distributions/*.tar"}, + ] + }], + ["@semantic-release/exec", { + "prepareCmd": "sed -i -e \"s/^version=.\\+$/version=${nextRelease.version}/g\" gradle.properties && ./gradlew distTar distZip" + }] + ] +} diff --git a/.github/workflows/create_release.yml b/legacy_workflows/create_release.yml similarity index 100% rename from .github/workflows/create_release.yml rename to legacy_workflows/create_release.yml diff --git a/.github/workflows/release_pr_workflow.yml b/release_pr_workflow.yml similarity index 100% rename from .github/workflows/release_pr_workflow.yml rename to release_pr_workflow.yml