From 906ce8ddad232e746ecf31629002fb3aa4d43849 Mon Sep 17 00:00:00 2001 From: Pascal Knecht Date: Sat, 14 Sep 2024 18:05:10 +0200 Subject: [PATCH] Simplify CI pipelines and add CLI releasing --- .github/workflows/build.yml | 22 ++++---------- .github/workflows/releaseCli.yml | 29 +++++++++++++++++++ ...rPlugin.yml => releaseConnectorPlugin.yml} | 15 +++------- .github/workflows/verify.yml | 27 ----------------- 4 files changed, 38 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/releaseCli.yml rename .github/workflows/{publishConnectorPlugin.yml => releaseConnectorPlugin.yml} (66%) delete mode 100644 .github/workflows/verify.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5899ec9..1a4af14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,7 @@ -name: Build project +name: Build (assemble & check) on: push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] workflow_dispatch: jobs: @@ -12,22 +9,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - - name: Check out project - uses: actions/checkout@v3 - - - name: Set up Java - uses: actions/setup-java@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' architecture: x64 - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 - - - name: Check project - run: ./gradlew check - + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - name: Build project run: ./gradlew build diff --git a/.github/workflows/releaseCli.yml b/.github/workflows/releaseCli.yml new file mode 100644 index 0000000..e456843 --- /dev/null +++ b/.github/workflows/releaseCli.yml @@ -0,0 +1,29 @@ +name: Release CLI app + +on: + push: + tags: + - "v*.*.*" + +jobs: + release: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + architecture: x64 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + - name: Assemble project distribution + run: ./gradlew :app:assembleDist + - name: Prepare release + uses: softprops/action-gh-release@v2 + with: + draft: true + files: | + app/build/distributions/dga.tar + app/build/distributions/dga.zip diff --git a/.github/workflows/publishConnectorPlugin.yml b/.github/workflows/releaseConnectorPlugin.yml similarity index 66% rename from .github/workflows/publishConnectorPlugin.yml rename to .github/workflows/releaseConnectorPlugin.yml index 6453663..cdc85c6 100644 --- a/.github/workflows/publishConnectorPlugin.yml +++ b/.github/workflows/releaseConnectorPlugin.yml @@ -1,4 +1,4 @@ -name: Publish Connector Plugin to Gradle Plugin Platform +name: Release Connector Plugin on: workflow_dispatch: @@ -8,22 +8,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - - name: Check out project - uses: actions/checkout@v3 - - - name: Set up Java - uses: actions/setup-java@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' architecture: x64 - - name: Set up Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 - + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - name: Validate connector plugin run: ./gradlew :connector-plugin:validatePlugins - - name: Publish connector plugin run: ./gradlew :connector-plugin:publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PLUGIN_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PLUGIN_SECRET }} diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml deleted file mode 100644 index 73c10c1..0000000 --- a/.github/workflows/verify.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Verify project - -on: - push: - workflow_dispatch: - -jobs: - verify: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - - name: Check out project - uses: actions/checkout@v3 - - - name: Set up Java - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'temurin' - architecture: x64 - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 - - - name: Check project - run: ./gradlew check