Skip to content

Commit 00f8066

Browse files
committed
Setup Actions CI
1 parent a67569c commit 00f8066

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Diff for: .github/workflows/ci.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [ master ]
5+
tags:
6+
- '*'
7+
pull_request:
8+
branches: [ master ]
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up JDK 1.8
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 1.8
18+
- name: Build with Gradle
19+
run: ./gradlew build executableZip
20+
- name: Create release
21+
if: startsWith(github.ref, 'refs/tags/')
22+
id: create_release
23+
uses: actions/create-release@v1
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: ${{ github.ref }}
28+
release_name: ${{ github.ref }}
29+
- id: get-tag-version
30+
if: startsWith(github.ref, 'refs/tags/')
31+
run: |
32+
version=$(echo ${{github.ref}} | cut -f3 -d/ | sed 's/^v//')
33+
echo "::set-output name=version::$version"
34+
- name: Upload release asset
35+
if: startsWith(github.ref, 'refs/tags/')
36+
uses: actions/upload-release-asset@v1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
upload_url: ${{ steps.create_release.outputs.upload_url }}
41+
asset_path: build/distributions/kmql-bin-${{ steps.get-tag-version.outputs.version }}.zip
42+
asset_name: kmql-bin-${{ steps.get-tag-version.outputs.version }}.zip
43+
asset_content_type: application/zip

0 commit comments

Comments
 (0)