Skip to content

Commit ca9f10f

Browse files
feat: github ci
1 parent e1c1215 commit ca9f10f

File tree

4 files changed

+60
-58
lines changed

4 files changed

+60
-58
lines changed

.github/workflows/release-app.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release App
2+
3+
on: push
4+
5+
jobs:
6+
create_release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-java@v2
11+
with:
12+
distribution: 'temurin'
13+
java-version: '11'
14+
- name: Extract project version
15+
run: |
16+
VERSION=$(./gradlew properties -q | grep "version:" | cut -d ' ' -f 2)
17+
echo "VERSION=$VERSION" >> $GITHUB_ENV
18+
- name: Build app
19+
run: |
20+
chmod +x gradlew
21+
./gradlew clean build
22+
- name: Create release
23+
if: github.ref == 'refs/heads/master'
24+
uses: marvinpinto/action-automatic-releases@latest
25+
id: create_release
26+
with:
27+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
28+
automatic_release_tag: latest
29+
prerelease: false
30+
title: "Release Modulo Application Plugin ${{ env.VERSION }}"
31+
file: |
32+
build/libs/modulo-application-plugin-${{ env.VERSION }}.jar
33+
build/libs/modulo-application-plugin-${{ env.VERSION }}-groovydoc.jar
34+
build/libs/modulo-application-plugin-${{ env.VERSION }}-javadoc.jar
35+
build/libs/modulo-application-plugin-${{ env.VERSION }}-sources.jar
36+
env:
37+
GITHUB_TOKEN: ${{ github.token }}
38+
publish_gradle_plugin_portal:
39+
if: github.ref == 'refs/heads/master'
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v2
43+
- uses: actions/setup-java@v2
44+
with:
45+
distribution: 'temurin'
46+
java-version: '11'
47+
- name: Define Gradle API Keys
48+
env:
49+
PROPERTIES_FILE: gradle.properties
50+
GRADLE_API_KEY: ${{ secrets.GRADLE_API_KEY }}
51+
GRADLE_PUBLISH_API_KEY: ${{ secrets.GRADLE_PUBLISH_API_KEY }}
52+
run: |
53+
echo "gradle.publish.key=${{ env.GRADLE_API_KEY }}" >> ${{ env.PROPERTIES_FILE }}
54+
echo "gradle.publish.secret=${{ env.GRADLE_PUBLISH_API_KEY }}" >> ${{ env.PROPERTIES_FILE }}
55+
- name: Publish plugin to Gradle Plugin Portal
56+
run: |
57+
chmod +x gradlew
58+
./gradlew publishPlugins

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ plugins {
55
id 'maven-publish'
66
}
77

8-
version = '0.0.1'
8+
version = '0.0.2'
99
group = 'com.chillycheesy'
1010

1111
repositories {
1212
mavenCentral()
1313
}
1414

1515
dependencies {
16-
gradleApi()
16+
implementation gradleApi()
1717
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.19'
1818
}
1919

gradlew

100644100755
File mode changed.

src/main/groovy/com/chillycheesy/modulo/extensions/ModuleExtension.groovy

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -51,60 +51,4 @@ class ModuleExtension {
5151
target = "${project.projectDir.path}/src/main/resources"
5252
}
5353

54-
/**
55-
* Set the name.
56-
* @param moduleName The new name.
57-
*/
58-
void moduleName(String moduleName) {
59-
this.moduleName = moduleName
60-
}
61-
62-
/**
63-
* Set the main.
64-
* @param main The new main.
65-
*/
66-
void main(String main) {
67-
this.main = main
68-
}
69-
70-
/**
71-
* Set the version.
72-
* @param version The new Version.
73-
*/
74-
void version(String version) {
75-
this.version = version
76-
}
77-
78-
/**
79-
* Set the path where generate the plugin.yml file.
80-
* @param target The new path
81-
*/
82-
void target(String target) {
83-
this.target = target
84-
}
85-
86-
/**
87-
* Set the authors.
88-
* @param authors The new authors List.
89-
*/
90-
void authors(List<String> authors) {
91-
this.authors = authors
92-
}
93-
94-
/**
95-
* Set the dependencies
96-
* @param dependencies The new dependencies List.
97-
*/
98-
void dependencies(List<String> dependencies) {
99-
this.dependencies = dependencies
100-
}
101-
102-
/**
103-
* Set the soft dependencies
104-
* @param softDependencies The new soft dependencies List.
105-
*/
106-
void softDependencies(List<String> softDependencies) {
107-
this.softDependencies = softDependencies
108-
}
109-
11054
}

0 commit comments

Comments
 (0)