forked from spinnaker/gate
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): Remove TravisCI and replace with GitHub Actions (spinnak…
- Loading branch information
Showing
9 changed files
with
112 additions
and
79 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Branch Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- version-* | ||
|
||
jobs: | ||
branch-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- 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 -PenablePublishing=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" build snapshot --stacktrace |
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,54 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: git fetch --prune --unshallow | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Assemble release info | ||
id: release_info | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
. .github/workflows/release_info.sh ${{ github.event.repository.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 -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" candidate | ||
- 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 | ||
run: | | ||
./gradlew -PenablePublishing=true --info -Prelease.disableGitChecks=true -Prelease.useLastTag=true -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" final | ||
- name: Create release | ||
if: steps.release_info.outputs.SKIP_RELEASE == 'false' | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.event.repository.name }} ${{ github.ref }} | ||
body: | | ||
${{ steps.release_info.outputs.CHANGELOG }} | ||
draft: false | ||
prerelease: ${{ steps.release_info.outputs.IS_CANDIDATE }} |
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,31 @@ | ||
#!/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/'` | ||
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` | ||
echo "CHANGELOG=$CHANGELOG" | ||
|
||
#Format the changelog so it's markdown compatible | ||
CHANGELOG="${CHANGELOG//$'%'/%25}" | ||
CHANGELOG="${CHANGELOG//$'\n'/%0A}" | ||
CHANGELOG="${CHANGELOG//$'\r'/%0D}" | ||
|
||
# If the previous release tag is the same as this tag the user likely cut a release (and in the process created a tag), which means we can skip the need to create a release | ||
export SKIP_RELEASE=`[[ "$PREVIOUS_TAG" = "$NEW_TAG" ]] && echo "true" || echo "false"` | ||
|
||
# https://github.com/fsaintjacques/semver-tool/blob/master/src/semver#L5-L14 | ||
NAT='0|[1-9][0-9]*' | ||
ALPHANUM='[0-9]*[A-Za-z-][0-9A-Za-z-]*' | ||
IDENT="$NAT|$ALPHANUM" | ||
FIELD='[0-9A-Za-z-]+' | ||
SEMVER_REGEX="\ | ||
^[vV]?\ | ||
($NAT)\\.($NAT)\\.($NAT)\ | ||
(\\-(${IDENT})(\\.(${IDENT}))*)?\ | ||
(\\+${FIELD}(\\.${FIELD})*)?$" | ||
|
||
# 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"` |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.