Skip to content

Commit 2e635e3

Browse files
committed
Add CI
1 parent 2d7d64b commit 2e635e3

File tree

5 files changed

+149
-0
lines changed

5 files changed

+149
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Outline the steps to reproduce the behaviour. This may include HTTP request/response details
15+
(headers, bodies, status codes). Small code snippets may be used here, however if the code
16+
required to describe the problem is too big, please link to a gist/repository with a
17+
reproduction of the issue.
18+
19+
1.
20+
2.
21+
3.
22+
23+
**Expected behaviour**
24+
A clear and concise description of what you expected to happen.
25+
26+
**Versions:**
27+
- Kotlin version
28+
- Library version
29+
30+
**Additional context**
31+
Add any other context about the problem here.
32+
33+
This can include any ideas about a fix, or a proposed solution.

.github/ISSUE_TEMPLATE/chore.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Chore
3+
about: A piece of work to do with managing the repo
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**What's the chore?**
11+
A clear and concise description of what the chore is.
12+
13+
**Why do we need to do it?**
14+
Why should we do the chore?
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature Request
3+
about: Request a new feature
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Feature Summary**
11+
12+
What is the feature. The more descriptive the easier it will be to implement
13+
14+
**Feature Rationale**
15+
16+
Why do you want the feature? Who does the feature help? How is it an improvement on what the
17+
library currently offers?
18+
19+
**Additional information**
20+
21+
Implementation ideas, or additional context for the feature.

.github/workflows/ci.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'api-sdk-creator-jvm'
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Set git config
18+
run: |
19+
git config user.name github-actions
20+
git config user.email [email protected]
21+
22+
- name: Setup Java 11
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 11
26+
27+
- name: Test
28+
uses: burrunan/gradle-cache-action@v1
29+
with:
30+
arguments: test
31+
32+
#- name: Update docs
33+
# if: ${{ github.ref == 'refs/heads/main' }}
34+
# run: |
35+
# ./gradlew dokkaHtml
36+
# git add sdk/docs/
37+
# git commit -m 'Updated docs' || echo "No changes to docs"
38+
# git push
39+
40+
- name: Tag
41+
if: ${{ github.ref == 'refs/heads/main' }}
42+
run: |
43+
./scripts/tag.sh gson
44+
./scripts/tag.sh ok-http
45+
env:
46+
GH_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
47+
48+
- name: Push changes
49+
if: ${{ github.ref == 'refs/heads/main' }}
50+
run: |
51+
git push
52+
git push --tags

scripts/tag.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/sh
2+
3+
if [ $# -lt 1 ] ; then
4+
echo "Usage $(basename $0) <module>"
5+
exit 1
6+
fi
7+
8+
module=$1
9+
version=$(./gradlew :${module}:properties | grep '^version:' | sed -e 's/^version: \(.*\)$/v\1/')
10+
tag="${module}_${version}"
11+
12+
# When GH Actions checks out the repo it doesn't pull tags
13+
echo "Fetching tags"
14+
git fetch --tags
15+
16+
echo "Checking for ${tag}"
17+
18+
if git show-ref --tags $tag --quiet; then
19+
echo "Tag exists"
20+
else
21+
echo "Tagging with ${tag}"
22+
git tag $tag
23+
24+
# Need to push to GH to then create a release
25+
git push --tags
26+
27+
echo $GH_AUTH_TOKEN | gh auth login --with-token
28+
gh release create $tag
29+
fi

0 commit comments

Comments
 (0)