-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate plugin to Gradle build and GH actions release
- Loading branch information
1 parent
ce8ff05
commit 153a80d
Showing
16 changed files
with
548 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: maven | ||
- package-ecosystem: gradle | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: friday | ||
open-pull-requests-limit: 99 | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: friday | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This workflow will build a Java project with Gradle | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: Testing For PRs | ||
|
||
on: [ pull_request ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- name: Build with Gradle | ||
run: ./gradlew assemble check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
name: Create Stable Release | ||
|
||
# Controls when the action will run. Workflow runs when manually triggered using the UI | ||
# or API. | ||
on: | ||
workflow_dispatch: | ||
# Inputs the workflow accepts. | ||
inputs: | ||
prerelease: | ||
description: 'The release should be an experimental release' | ||
default: 'NO' | ||
required: true | ||
|
||
jobs: | ||
build_and_release: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_USER: "gocd-contrib" | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
PRERELEASE: "${{ github.event.inputs.prerelease }}" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- name: Release | ||
run: ./gradlew githubRelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This workflow will build a Java project with Gradle | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: Test and Build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- name: Test with Gradle | ||
run: ./gradlew assemble check | ||
previewGithubRelease: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_USER: "gocd-contrib" | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- name: Test with Gradle | ||
run: ./gradlew githubRelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright 2022 Thoughtworks, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
apply plugin: 'java' | ||
apply from: "https://raw.githubusercontent.com/gocd/gocd-plugin-gradle-task-helpers/master/helper.gradle?_=${(int) (new Date().toInstant().epochSecond / 60)}" | ||
|
||
gocdPlugin { | ||
id = 'script-executor' | ||
pluginVersion = '1.0.2' | ||
goCdVersion = '20.1.0' | ||
name = 'Script Executor' | ||
description = 'Thoughtworks GoCD plugin to run scripts' | ||
vendorName = 'Srinivas Upadhya' | ||
vendorUrl = 'https://github.com/gocd-contrib/script-executor-task' | ||
|
||
githubRepo { | ||
owner = System.getenv('GITHUB_USER') ?: 'bob' | ||
repo = 'script-executor-task' | ||
token = System.getenv('GITHUB_TOKEN') ?: 'bad-token' | ||
} | ||
|
||
pluginProject = project | ||
|
||
prerelease = !"No".equalsIgnoreCase(System.getenv('PRERELEASE')) | ||
assetsToRelease = [project.tasks.jar] | ||
} | ||
|
||
sourceCompatibility = 1.11 | ||
targetCompatibility = 1.11 | ||
|
||
allprojects { | ||
group = 'cd.go.contrib' | ||
version = gocdPlugin.fullVersion(project) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
deps = [ | ||
gocdPluginApi: 'cd.go.plugin:go-plugin-api:22.3.0', | ||
] | ||
|
||
versions = project.ext.deps.collectEntries { lib, libGav -> [lib, libGav.split(':').last()] } | ||
} | ||
|
||
dependencies { | ||
compileOnly project.deps.gocdPluginApi | ||
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10' | ||
implementation group: 'commons-io', name: 'commons-io', version: '2.11.0' | ||
|
||
testImplementation platform('org.junit:junit-bom:5.9.1') | ||
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api' | ||
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params' | ||
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine' | ||
|
||
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.8.1' | ||
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.23.1' | ||
testImplementation group: 'cd.go.plugin', name: 'go-plugin-api', version: project.versions.gocdPluginApi | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
jar { | ||
from(configurations.runtimeClasspath) { | ||
into "lib/" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.