diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..aba8e82 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: ci +on: + push: + pull_request: + schedule: + - cron: '0 11 * * *' +jobs: + test: + timeout-minutes: 30 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - java: 8 + - java: 11 + steps: + - uses: olafurpg/setup-scala@v10 + with: + java-version: "adopt@1.${{ matrix.java }}" + - uses: actions/checkout@v2.3.4 + - uses: coursier/cache-action@v5 + - run: sbt -v test + - if: ${{ matrix.java == 8 }} # TODO https://github.com/sbt/sbt-proguard/issues/33 + run: | + sbt -v publishLocal "project plugin" "^ scripted" && + java -jar ./target/scala-2.11/proguard/conscript-*.jar --version + - uses: webfactory/ssh-agent@v0.4.1 + with: + ssh-private-key: ${{ secrets.DEPLOY_KEY_1 }} + - name: Push to gh-pages + if: ${{ !github.event.repository.fork && github.ref == 'refs/heads/master' && github.event_name == 'push' && matrix.java == 8 }} + run: | + git config --global user.email "74864734+foundweekends-bot[bot]@users.noreply.github.com" + git config --global user.name "foundweekends-bot[bot]" + # https://github.com/sbt/sbt-ghpages/commit/cbedd8edb8 + export SBT_GHPAGES_COMMIT_MESSAGE="auto commit on CI https://github.com/foundweekends/conscript/commit/${{ github.sha }}" + sbt -v pushSiteIfChanged diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 02cc4b7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: scala -sudo: false -dist: xenial -env: - global: - secure: MbkM6or1WrmhoEqpW6P3zkMFDY0uWvN9WyA/zIfLVRnlwx7FR2x6eGzXUUYc8eGvWvngvWyePRfGr+PGTq4sVRUGK6xZ1CcQIg8o/puFV7Ghfxf2BAxJQWhZhg2fvwx04NtEKV9+gLhB8NF+XnHHN6ZQr3bbgWIgDYYea7Ckd5M= -cache: - directories: - - "$HOME/.ivy2/cache" - - "$HOME/.sbt/launchers" -before_cache: -- find $HOME/.sbt -name "*.lock" | xargs rm -- find $HOME/.ivy2/cache -name "ivydata-*.properties" | xargs rm -matrix: - include: - - jdk: openjdk8 - script: - - sbt publishLocal test "project plugin" "^ scripted" - - java -jar ./target/scala-2.11/proguard/conscript-*.jar --version - - jdk: openjdk11 - script: - - sbt test # TODO https://github.com/sbt/sbt-proguard/issues/33 -after_success: -- ./publish-site.sh diff --git a/build.sbt b/build.sbt index 35667d2..68b5190 100644 --- a/build.sbt +++ b/build.sbt @@ -135,7 +135,6 @@ lazy val root = (project in file(".")). val repo = ghpagesUpdatedRepository.value val s = streams.value val r = GitKeys.gitRunner.value - gitConfig(repo, r, s.log) gitRemoveFiles(repo, (repo * "*.html").get.toList, r, s) val mappings = for { (file, target) <- siteMappings.value @@ -200,11 +199,3 @@ def gitDocsChanged(dir: File, git: GitRunner, log: Logger): Boolean = val stat = git(("diff" :: "--shortstat" :: range :: "docs" :: Nil) :_*)(dir, log) stat.trim.nonEmpty } - -def gitConfig(dir: File, git: GitRunner, log: Logger): Unit = - sys.env.get("TRAVIS") match { - case Some(_) => - git(("config" :: "user.name" :: "Travis CI" :: Nil) :_*)(dir, log) - git(("config" :: "user.email" :: "eed3si9n@gmail.com" :: Nil) :_*)(dir, log) - case _ => () - } diff --git a/deploy_key.enc b/deploy_key.enc deleted file mode 100644 index 653ead8..0000000 --- a/deploy_key.enc +++ /dev/null @@ -1,36 +0,0 @@ -U2FsdGVkX1/mLSu+fZKaBfEDrFbYrbVvQHeWxkOXR/h08uvg22Wpw2tJtkxteI1b -9cxNpdvwVscKLz8JNDoaq9TeUvZe9BEQjlZ4Nepk9gO14QRY7y7h13AqUtcC3tXs -eAL0DAUT5lyoPk6j7cnDCCTmDFEBI75mFJmmtnuCeAE9/xlO4uzEwX9SRLPcqlUw -jiqDMqACJBse/rjiK+uQP2icTIa6e/QZD5sUsXrKBM3Pu0R98EwUj+I7jNK0NDD9 -F8s7SOCtaS5h7WjwHoEeiFdsnG7NBCr6GZaG0yHtzc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0SdfEcRomNtFJqbDhOP9GJH5F8GLUUABNvFAMLLRBpbvLRX3itV0Gg6eHyEDFDF -/v4ZZTcQ43xIrhgEuzbf+lxvHasDPuG1xgMUw3j0F/stqD/LISHTM3+ZxW/XuXU0 -JdSyeIkQMBQNyJPoeWqwy1quXYSCAEtR8NCXcdMU+4yGPqxspVQkMyZvrVvVV0QH -4zGQpzx8si8gukSxrQLv2XIFYQIr2OiFV50Or2ZQq1DMTVckstQHu8bDKATZqiya -SPWsOE5BISlV6xVkPu3hv187euCulH5HQXz4ie7WxqV4x67DmoSgvoSLnoa6ekcx -VUp8DxAA8UZjJwYpbfw/PfOg/8RFODGlVpf9H3lEC8F/YjKsPAZ9Ujx04GpnhTL2 -6hiiunqkqS3C0Z7m2uCseFNmdP/KccEsAAcORv8aKv/GgubNxVjcsix/L1Itbwlx -MTuTCSVk3yJ8FtnEa0dKfzNu2wcOllvkdgZUBBEvzXk+krqOtaFtCbzbObOpFISo -fEmvaQkbRXmM3P6b53ZFDZt22rSQPLkz4TkVXStI1yM9ul6eLM0PwbrbgNIbL2dZ -URw8vALhAx/hQWbqJKnEYzNJvFYUxJl09nQA+36X+9nQvLU0QVMO2XMkZ/Ocy9TE -dnd6ZPixoC+/6Fng8cOi5bblLdxtHIX1YkPP1+0qST4hB2rzU9EByHhaUZYMinb+ -v256K/i4SieucYzl8lGHkT5ktqT8vdGtUvKzjZ/73kmxG0knSh8wBDRzI2bNIo22 -0H2DMmJS75gnFMyPfwVr4RwQcikuSjNNxYRqjnZdFCI2OAx90TsWkCQ1enoy/eFJ -bbLOqCyNieiyPspZWCH/l/A6bi1LWllZDMde0R758fq2dhn8TfRYgqqIoc0BQ/n+ -erd22FLmSvynBtv0SfGunA== diff --git a/publish-site.sh b/publish-site.sh deleted file mode 100755 index 8bb75c8..0000000 --- a/publish-site.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -ex - -if [[ "${JAVA_HOME}" == $(jdk_switcher home oraclejdk8) && "${TRAVIS_PULL_REQUEST}" == "false" && "${TRAVIS_BRANCH}" == "master" && "${TRAVIS_REPO_SLUG}" == "foundweekends/conscript" ]]; then - echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy_rsa\n" >> ~/.ssh/config - openssl aes-256-cbc -k "$SERVER_KEY" -in deploy_key.enc -d -a -out deploy_rsa - chmod 600 deploy_rsa - cp deploy_rsa ~/.ssh/ - sbt pushSiteIfChanged -fi