diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b84cf141e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI +on: + push: + branches: + - master + tags: + - "v*" + pull_request: + +jobs: + test: + name: ${{ matrix.os }} ${{ matrix.PLUGIN }} group ${{ matrix.TEST_GROUP }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + PLUGIN: [sbt-coursier, sbt-lm-coursier] + TEST_GROUP: [1, 2] + steps: + - name: Don't convert LF to CRLF during checkout + if: runner.os == 'Windows' + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: true + - uses: coursier/cache-action@v4 + - uses: olafurpg/setup-scala@v7 + with: + java-version: adopt@1.8.0-232 + - run: scripts/ci.sh + shell: bash + env: + PLUGIN: ${{ matrix.PLUGIN }} + TEST_GROUP: ${{ matrix.TEST_GROUP }} + + publish: + needs: test + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: true + - uses: coursier/cache-action@v4 + - uses: olafurpg/setup-scala@v7 + - uses: olafurpg/setup-gpg@v2 + - name: Release + run: ./sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 598a5ea37..000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: java -os: linux -jdk: openjdk8 -git: - depth: false # https://stackoverflow.com/a/51727114/3714539 -script: scripts/ci.sh -stages: - - name: test - - name: release - if: (branch = master AND type = push) OR (tag IS present) -jobs: - include: - - env: SBT_COURSIER=1 TEST_GROUP=1 - - env: SBT_COURSIER=1 TEST_GROUP=2 - - env: LM_COURSIER=1 TEST_GROUP=1 - - env: LM_COURSIER=1 TEST_GROUP=2 - - stage: release - script: ./sbt ci-release -branches: - only: - - master - - /^v\d+\.\d+.*$/ # tagged versions -cache: - directories: - - $HOME/.ivy2/cache - - $HOME/.sbt - - $HOME/.cache diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 26ee8e212..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Adapted from https://github.com/sbt/sbt-native-packager/blob/master/appveyor.yml -version: '{build}' -os: Windows Server 2012 -install: - - cmd: mkdir C:\sbt - - cmd: curl -Lo C:\sbt\sbt https://github.com/coursier/sbt-launcher/releases/download/v1.2.20/csbt - - cmd: curl -Lo C:\sbt\sbt.bat https://github.com/coursier/sbt-launcher/releases/download/v1.2.20/csbt.bat - - cmd: SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0 - - cmd: SET PATH=C:\sbt;%JAVA_HOME%\bin;%PATH% - - cmd: SET JAVA_OPTS=-Xmx4g -Xss2m - - git submodule update --init --recursive -environment: - TEST_REPOSITORY_HOST: localhost - TEST_REPOSITORY_PORT: 8080 - TEST_REPOSITORY_USER: user - TEST_REPOSITORY_PASSWORD: pass - TEST_REPOSITORY: http://localhost:8080 -build_script: - - cmd: .\metadata\coursier fetch io.get-coursier:http-server_2.12:1.0.0 - - ps: Start-Job -filepath .\metadata\scripts\start-it-auth-server.ps1 -ArgumentList $pwd\metadata, $env:TEST_REPOSITORY_HOST, $env:TEST_REPOSITORY_PORT, $env:TEST_REPOSITORY_USER, $env:TEST_REPOSITORY_PASSWORD -test_script: - - sbt ++2.12.11 "sbt-lm-coursier/scripted shared-2/simple" sbt-coursier/scripted -branches: - only: - - master diff --git a/scripts/ci.sh b/scripts/ci.sh index 4784b68ce..cd84b98ca 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -2,7 +2,7 @@ set -euvx lmCoursier() { - [ "${LM_COURSIER:-""}" = 1 ] + [ "${PLUGIN:-""}" = "sbt-lm-coursier" ] } sbtShading() {