Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to github actions #221

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/pr_workflow.yml
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@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: adopt
- name: Build with Gradle
run: ./gradlew assemble check
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

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@v2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: adopt
- name: Release
run: ./gradlew verifyExpRelease githubRelease
release_dsl_maven_central:
needs: build_and_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: adopt
# - name: Import GPG key
# id: import_gpg
# uses: crazy-max/ghaction-import-gpg@v4
# with:
# gpg_private_key: ${{ secrets.GOCD_GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.GOCD_GPG_PASSPHRASE }}
- name: Import GPG key
run: echo "TODO - need to get gpg key into signing-key.gpg or into gpg-agent and then use https://docs.gradle.org/current/userguide/signing_plugin.html#sec:using_gpg_agent" && exit 1
- name: Release DSL to Maven Central
env:
GOCD_NEXUS_USERNAME: "arvindsv"
GOCD_NEXUS_PASSWORD: "${{ secrets.GOCD_NEXUS_PASSWORD }}"
GOCD_GPG_KEY_ID: "${{ secrets.GOCD_GPG_KEY_ID }}"
GOCD_GPG_KEYRING_FILE: "signing-key.gpg"
GOCD_GPG_PASSPHRASE: "${{ secrets.GOCD_GPG_PASSPHRASE }}"
run: ./gradlew clean dsl:publishToSonatype closeAndReleaseSonatypeStagingRepository
38 changes: 38 additions & 0 deletions .github/workflows/test_and_build.yml
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@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: adopt
- 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@v2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 17
distribution: adopt
- name: Test with Gradle
run: ./gradlew githubRelease
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ java {

gocdPlugin {
id = 'cd.go.contrib.plugins.configrepo.groovy'
pluginVersion = '2.1.0'
pluginVersion = '2.2.0'
goCdVersion = '20.8.0'
name = 'GoCD Groovy Configuration plugin'
description = 'GoCD pipelines and environments configuration in Groovy'
Expand Down