Skip to content

Commit 568620e

Browse files
authored
solution: CI setup
1 parent d50a3d2 commit 568620e

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed

.github/workflows/publish.yaml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-github:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
with:
13+
ref: ${{ github.ref }}
14+
- name: Set up JDK
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 21
18+
- name: Check
19+
uses: eskatos/gradle-command-action@v1
20+
with:
21+
arguments: check
22+
- name: Build
23+
uses: eskatos/gradle-command-action@v1
24+
with:
25+
arguments: build
26+
- name: Sync Jars
27+
uses: eskatos/gradle-command-action@v1
28+
with:
29+
arguments: syncJars
30+
- name: Upload Jars
31+
id: upload-release-asset
32+
uses: svenstaro/upload-release-action@v1-release
33+
with:
34+
repo_token: ${{ secrets.GITHUB_TOKEN }}
35+
tag: ${{ github.ref }}
36+
file: ./build/libs/*.jar
37+
file_glob: true
38+
39+
publish-gcp-artifacts:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@master
43+
with:
44+
ref: ${{ github.ref }}
45+
- name: Set up JDK
46+
uses: actions/setup-java@v1
47+
with:
48+
java-version: 21
49+
- name: Check
50+
uses: eskatos/gradle-command-action@v1
51+
with:
52+
arguments: check
53+
- name: Setup GCP
54+
uses: google-github-actions/setup-gcloud@v0
55+
with:
56+
project_id: ${{ secrets.GCP_PROJECT_ID }}
57+
service_account_key: ${{ secrets.GCP_ARTIFACTS_KEY }}
58+
export_default_credentials: true
59+
- name: Upload to GCP
60+
uses: eskatos/gradle-command-action@v1
61+
with:
62+
arguments: publish

.github/workflows/test.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests
2+
3+
on:
4+
# if pushed directly to the master
5+
push:
6+
branches:
7+
- master
8+
- release/*
9+
- ci/*
10+
# on a pull request
11+
pull_request:
12+
branches:
13+
- master
14+
- release/*
15+
- ci/*
16+
17+
jobs:
18+
unit-test:
19+
name: Standard Unit Test
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Set up JDK
25+
uses: actions/setup-java@v1
26+
with:
27+
java-version: 21
28+
29+
- name: Check
30+
uses: eskatos/gradle-command-action@v1
31+
with:
32+
arguments: check

0 commit comments

Comments
 (0)