From 122b50437fd65e8863c8eefccf98879330c44723 Mon Sep 17 00:00:00 2001 From: Jeremy Collins Date: Mon, 21 Feb 2022 12:46:06 -0500 Subject: [PATCH] Migrate to Github Actions --- .github/workflows/gyro-azure-provider.yml | 37 +++++++++++++++++++++++ .travis.yml | 17 ----------- build.gradle | 5 +-- 3 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/gyro-azure-provider.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/gyro-azure-provider.yml b/.github/workflows/gyro-azure-provider.yml new file mode 100644 index 00000000..e2a24a98 --- /dev/null +++ b/.github/workflows/gyro-azure-provider.yml @@ -0,0 +1,37 @@ +name: gyro-azure-provider + +on: + push: + branches: + - master + - release/* + + pull_request: + branches: + - master + - release/* + +env: + GITHUB_ACTIONS_PULL_REQUEST: ${{ github.event.pull_request.number }} + GRADLE_DEPLOY_USER: ${{ secrets.GRADLE_DEPLOY_USER }} + GRADLE_DEPLOY_PASSWORD: ${{ secrets.GRADLE_DEPLOY_PASSWORD }} + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'temurin' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5e03d788..00000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -sudo: false - -if: type = push - -branches: - only: - - master - - /^release\/.*/ - -language: java - -jdk: - - openjdk11 - -install: true - -script: ./gradlew \ No newline at end of file diff --git a/build.gradle b/build.gradle index 15941527..09470611 100644 --- a/build.gradle +++ b/build.gradle @@ -22,10 +22,11 @@ plugins { def releaseVersion = '0.99.3' def releaseBuild = false; -if (System.getenv('TRAVIS_BRANCH') && System.getenv('TRAVIS_PULL_REQUEST') == 'false') { +if (System.getenv('CI')) { defaultTasks 'build', 'publish' - releaseBuild = System.getenv('TRAVIS_BRANCH').startsWith("release/"); + releaseBuild = System.getenv('GITHUB_ACTIONS_PULL_REQUEST') == '' && + System.getenv('GITHUB_REF').startsWith("refs/head/release/"); } else { defaultTasks 'build', 'publishToMavenLocal' }