Skip to content

Commit b309784

Browse files
authored
Merge pull request #94 from trocco-io/add_github-actions
Add github-actions
2 parents 68bc5aa + 0118207 commit b309784

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/gem-push.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Ruby Gem
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'main'
8+
tags:
9+
- '*'
10+
pull_request:
11+
branches:
12+
- '*'
13+
types: [ opened, synchronize ]
14+
15+
jobs:
16+
build:
17+
name: Build + Publish
18+
runs-on: ubuntu-latest
19+
permissions:
20+
packages: write
21+
contents: read
22+
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'tags/v') }}
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up Ruby 2.7
26+
uses: ruby/setup-ruby@v1
27+
with:
28+
ruby-version: 2.7
29+
- name: push gem
30+
uses: trocco-io/push-gem-to-gpr-action@v1
31+
with:
32+
language: java
33+
gem-path: "./build/gems/*.gem"
34+
github-token: "${{ secrets.GITHUB_TOKEN }}"

build.gradle

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id "checkstyle"
55
id "maven-publish"
66
id "org.embulk.embulk-plugins" version "0.4.1"
7+
id "com.palantir.git-version" version "0.12.3"
78
}
89

910
repositories {
@@ -12,9 +13,17 @@ repositories {
1213
}
1314

1415
group = "io.trocco"
15-
version = "0.1.0"
1616
description = "Bigquery output for embulk"
1717

18+
version = {
19+
def vd = versionDetails()
20+
if (vd.commitDistance == 0 && vd.lastTag ==~ /^v[0-9]+\.[0-9]+\.[0-9]+(\.[a-zA-Z0-9]+)?/) {
21+
vd.lastTag.substring(1)
22+
} else {
23+
"0.0.0.${vd.gitHash}.pre"
24+
}
25+
}()
26+
1827
sourceCompatibility = 1.8
1928
targetCompatibility = 1.8
2029

0 commit comments

Comments
 (0)