From 5aef6d062aa0576473d5c7c1797ceacc0de30b75 Mon Sep 17 00:00:00 2001 From: Tetsuro Sano Date: Wed, 10 Jan 2024 10:17:00 +0900 Subject: [PATCH] Added gem publishing workflow --- .github/workflows/gem-push.yml | 36 ++++++++++++++++++++++++++++++++++ build.gradle | 7 +++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/gem-push.yml diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml new file mode 100644 index 00000000..6c74c7a7 --- /dev/null +++ b/.github/workflows/gem-push.yml @@ -0,0 +1,36 @@ +name: Ruby Gem + +on: + workflow_dispatch: + push: + tags: + - '*' + +jobs: + build: + name: Build + Publish + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + strategy: + matrix: + type: + - jdbc + - mysql + - postgresql + - redshift + - sqlserver + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby 2.7 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + - name: push gem + uses: t3t5u/push-gem-to-gpr-action@v1 + with: + language: java + gem-path: "embulk-output-${{ matrix.type }}/build/gems/*.gem" + github-token: "${{ secrets.GITHUB_TOKEN }}" + gradle-subproject: "embulk-output-${{ matrix.type }}" diff --git a/build.gradle b/build.gradle index 2c45435f..ad92bc6a 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ plugins { id "signing" id 'checkstyle' id "org.embulk.embulk-plugins" version "0.6.2" apply false + id "com.palantir.git-version" version "3.0.0" } allprojects { @@ -15,11 +16,16 @@ allprojects { description = "Inserts or updates records to a table." } +ext { + troccoVersion = "0.0.1" +} + subprojects { apply plugin: 'java' apply plugin: "maven-publish" apply plugin: "signing" apply plugin: "org.embulk.embulk-plugins" + apply plugin: 'com.palantir.git-version' //apply plugin: 'jacoco' repositories { @@ -106,6 +112,7 @@ subprojects { summary = "JDBC output plugin for Embulk" homepage = "https://github.com/embulk/embulk-output-jdbc" licenses = [ "Apache-2.0" ] + archiveVersion = "${project.version}.trocco.${project.troccoVersion}" into("default_jdbc_driver") { from configurations.defaultJdbcDriver