Skip to content

Commit 60144bc

Browse files
author
Alessio Coser
committed
script for auto-deploy
1 parent bc83a63 commit 60144bc

File tree

6 files changed

+62
-16
lines changed

6 files changed

+62
-16
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Continuous Integration
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v1
8+
- name: Test
9+
run: ./gradlew clean test
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish on JitPack
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v1
12+
- name: Test
13+
run: ./gradlew clean test
14+
- name: Create release
15+
uses: actions/create-release@v1
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
tag_name: ${{ github.ref }}
20+
release_name: ${{ github.ref }}
21+
draft: false
22+
prerelease: false
23+
- name: Publish on JitPack
24+
env:
25+
GITHUB_REF: ${{ github.ref }}
26+
run: |
27+
echo "https://jitpack.io/api/builds/com.github.${{ github.repository }}/${GITHUB_REF##*/}"
28+
curl "https://jitpack.io/api/builds/com.github.${{ github.repository }}/${GITHUB_REF##*/}"

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
*.iml
33
.gradle
44
build
5-
out
6-
publish.sh
5+
out

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repositories {
2121
```
2222
- Add the dependency
2323
```
24-
implementation 'com.github.DaikonWeb:daikon-gson:1.0.0'
24+
implementation('com.github.DaikonWeb:daikon-gson:1.0.0')
2525
```
2626

2727
### Maven

build.gradle

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,27 @@ plugins {
22
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
33
}
44

5-
group 'daikon.gson'
6-
version '1.0.0'
7-
85
repositories {
96
mavenCentral()
107
maven { url 'https://jitpack.io' }
118
}
129

1310
dependencies {
14-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
15-
implementation "com.github.DaikonWeb:daikon:1.0.0"
16-
compile "com.google.code.gson:gson:2.8.6"
17-
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
18-
testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.1")
19-
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.5.1")
20-
testImplementation("net.wuerl.kotlin:assertj-core-kotlin:0.2.1")
21-
testImplementation("com.github.jkcclemens:khttp:0.1.0")
11+
implementation('org.jetbrains.kotlin:kotlin-stdlib-jdk8')
12+
implementation('com.github.DaikonWeb:daikon:1.0.0')
13+
compile('com.google.code.gson:gson:2.8.6')
14+
testImplementation('com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0')
15+
testImplementation('org.junit.jupiter:junit-jupiter-api:5.5.1')
16+
testImplementation('org.junit.jupiter:junit-jupiter-engine:5.5.1')
17+
testImplementation('net.wuerl.kotlin:assertj-core-kotlin:0.2.1')
18+
testImplementation('com.github.jkcclemens:khttp:0.1.0')
2219
}
2320

2421
compileKotlin {
25-
kotlinOptions.jvmTarget = "1.8"
22+
kotlinOptions.jvmTarget = '1.8'
2623
}
2724
compileTestKotlin {
28-
kotlinOptions.jvmTarget = "1.8"
25+
kotlinOptions.jvmTarget = '1.8'
2926
}
3027

3128
test {

scripts/publish.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env sh
2+
PROJECT_DIR=$(cd $(dirname $0)/..; pwd -P)
3+
PROJECT_NAME=$(basename $PROJECT_DIR)
4+
TAG=$1
5+
6+
sed -ie "s|'com.github.DaikonWeb:daikon:.*'|'com.github.DaikonWeb:daikon:${TAG}'|g" build.gradle
7+
sed -ie "s|'com.github.DaikonWeb:${PROJECT_NAME}:.*'|'com.github.DaikonWeb:${PROJECT_NAME}:${TAG}'|g" README.md
8+
sed -ie "s|<version>.*</version>|<version>${TAG}</version>|g" README.md
9+
10+
git commit -am "Release ${TAG}"
11+
git tag $TAG
12+
git push
13+
git push --tags

0 commit comments

Comments
 (0)