chore(build): update to newer spinnaker project plugin
MODIFY
.github/workflows/build.yml
.github/workflows/build.yml
@@ -6,6 +6,9 @@ on:
- master
- version-*
+env:
+ GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx6g -Xms6g
+
jobs:
branch-build:
# Only run this on repositories in the 'spinnaker' org, not on forks.
@@ -21,9 +24,11 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: 11
+ - uses: actions/cache@v1
+ with:
+ path: ~/.gradle
+ key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
+ restore-keys: |
+ ${{ runner.os }}-gradle-
- name: Build
- env:
- BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
- BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace
+ run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace

MODIFY
.github/workflows/pr.yml
.github/workflows/pr.yml
@@ -2,6 +2,9 @@ name: PR Build
on: [ pull_request ]
+env:
+ GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx6g -Xms6g
+
jobs:
build:
runs-on: ubuntu-latest
@@ -22,6 +25,4 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
- env:
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: ./gradlew -PenableCrossCompilerPlugin=true build javadoc
+ run: ./gradlew -PenableCrossCompilerPlugin=true build

MODIFY
.github/workflows/release.yml
.github/workflows/release.yml
@@ -6,6 +6,9 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
+env:
+ GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx6g -Xms6g
+
jobs:
release:
runs-on: ubuntu-latest
@@ -25,26 +28,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- . .github/workflows/release_info.sh ${{ github.event.repository.name }}
+ . .github/workflows/release_info.sh ${{ github.event.repository.full_name }}
echo ::set-output name=CHANGELOG::$(echo -e "${CHANGELOG}")
echo ::set-output name=SKIP_RELEASE::${SKIP_RELEASE}
echo ::set-output name=IS_CANDIDATE::${IS_CANDIDATE}
- - name: Candidate build
- if: steps.release_info.outputs.IS_CANDIDATE == 'true'
- env:
- BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
- BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
- run: |
- ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate
+ echo ::set-output name=RELEASE_VERSION::${RELEASE_VERSION}
- name: Release build
if: steps.release_info.outputs.IS_CANDIDATE == 'false'
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
- GRADLE_OPTS: -Xmx6g -Xms6g -Dorg.gradle.daemon=false
+ RELEASE_VERSION: ${{ steps.release_info.outputs.RELEASE_VERSION }}
run: |
- ./gradlew -PenableCrossCompilerPlugin=true -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final
+ ./gradlew --info -Pversion="${RELEASE_VERSION}" -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" publish
- name: Create release
if: steps.release_info.outputs.SKIP_RELEASE == 'false'
uses: actions/create-release@v1

MODIFY
.github/workflows/release_info.sh
.github/workflows/release_info.sh
#!/bin/bash -x
# Only look to the latest release to determine the previous tag -- this allows us to skip unsupported tag formats (like `version-1.0.0`)
-export PREVIOUS_TAG=`curl --silent "https://api.github.com/repos/spinnaker/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
+export PREVIOUS_TAG=`curl --silent "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
echo "PREVIOUS_TAG=$PREVIOUS_TAG"
+
export NEW_TAG=${GITHUB_REF/refs\/tags\//}
echo "NEW_TAG=$NEW_TAG"
export CHANGELOG=`git log $NEW_TAG...$PREVIOUS_TAG --oneline`
@@ -29,3 +30,6 @@ SEMVER_REGEX="\
# Used in downstream steps to determine if the release should be marked as a "prerelease" and if the build should build candidate release artifacts
export IS_CANDIDATE=`[[ $NEW_TAG =~ $SEMVER_REGEX && ! -z ${BASH_REMATCH[4]} ]] && echo "true" || echo "false"`
+
+export RELEASE_VERSION=`[[ $NEW_TAG =~ $SEMVER_REGEX ]] && echo "${NEW_TAG:1}" || echo "${NEW_TAG}"`
+echo "RELEASE_VERSION=$RELEASE_VERSION"

MODIFY
build.gradle
build.gradle
-buildscript {
- ext {
- kotlinVersion = "1.3.71"
- }
- repositories {
- jcenter()
- maven { url "https://spinnaker.bintray.com/gradle" }
- maven { url "https://plugins.gradle.org/m2/" }
- }
- dependencies {
- classpath "com.netflix.spinnaker.gradle:spinnaker-dev-plugin:$spinnakerGradleVersion"
- classpath "com.netflix.nebula:nebula-kotlin-plugin:$kotlinVersion"
- if (Boolean.valueOf(enablePublishing)) {
- classpath "com.netflix.spinnaker.gradle:spinnaker-gradle-project:$spinnakerGradleVersion"
-// TODO: nebula-publishing-plugin version override should be removed as soon as spinnaker-gradle-project is updated
-// this override is needed to omit compileOnly dependencies from generated pom.xml
- classpath "com.netflix.nebula:nebula-publishing-plugin:12.0.1"
- }
- }
+plugins {
+ id 'io.spinnaker.project' version "$spinnakerGradleVersion" apply false
+ id "nebula.kotlin" version "$kotlinVersion" apply false
+ id "org.jetbrains.kotlin.plugin.allopen" version "$kotlinVersion" apply false
+ id "org.jetbrains.dokka" version "0.10.1" apply false
}
allprojects {
+ apply plugin: 'io.spinnaker.project'
+
group = "com.netflix.spinnaker.gate"
- apply plugin: 'spinnaker.base-project'
- if (Boolean.valueOf(enablePublishing)) {
- apply plugin: 'spinnaker.project'
- }
if (name != "gate-bom") {
apply plugin: 'java-library'

MODIFY
gate-bom/gate-bom.gradle
gate-bom/gate-bom.gradle
@@ -21,17 +21,6 @@ javaPlatform {
allowDependencies()
}
-
-if (Boolean.valueOf(enablePublishing)) {
- publishing {
- publications {
- nebula(MavenPublication) {
- from components.javaPlatform
- }
- }
- }
-}
-
dependencies {
api(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion"))

MODIFY
gate-web/gate-web.gradle
gate-web/gate-web.gradle
-apply plugin: 'spinnaker.application'
+apply plugin: 'io.spinnaker.package'
ext {
springConfigLocation = System.getProperty('spring.config.additional-location', "${System.getProperty('user.home')}/.spinnaker/")

MODIFY
gradle.properties
gradle.properties
@@ -3,4 +3,5 @@ fiatVersion=1.18.3
includeProviders=basic,iap,ldap,oauth2,saml,x509
korkVersion=7.37.0
org.gradle.parallel=true
-spinnakerGradleVersion=7.11.6
+spinnakerGradleVersion=8.0.0-rc.3
+kotlinVersion=1.3.71

MODIFY
gradle/wrapper/gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

chore(build): update to newer spinnaker project plugin (#1159)