-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add GitHub Actions CI * Derive publish version from Git tag * Remove Travis * Remove Travis CI files
- Loading branch information
1 parent
9fce2f1
commit bb0f725
Showing
10 changed files
with
98 additions
and
225 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,95 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ '8', '9' ] | ||
name: Tests for Java ${{ matrix.Java }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: ${{ matrix.java }} | ||
- name: Run tests | ||
run: | | ||
set -eux | ||
./mill -i --disable-ticker __.testLocal | ||
publish-sonatype: | ||
if: github.repository == 'com-lihaoyi/cask' && contains(github.ref, 'refs/tags/') | ||
needs: test | ||
runs-on: ubuntu-latest | ||
env: | ||
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }} | ||
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }} | ||
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
LANG: "en_US.UTF-8" | ||
LC_MESSAGES: "en_US.UTF-8" | ||
LC_ALL: "en_US.UTF-8" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 9 | ||
- name: Publish to Maven Central | ||
run: | | ||
if [[ $(git tag --points-at HEAD) != '' ]]; then | ||
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key | ||
gpg --import --no-tty --batch --yes gpg_key | ||
rm gpg_key | ||
./mill -i mill.scalalib.PublishModule/publishAll \ | ||
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \ | ||
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \ | ||
--publishArtifacts __.publishArtifacts \ | ||
--readTimeout 600000 \ | ||
--awaitTimeout 600000 \ | ||
--release true \ | ||
--signed true | ||
fi | ||
- name: Create GitHub Release | ||
id: create_gh_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: | ||
draft: false | ||
|
||
generate_docs: | ||
if: github.repository == 'com-lihaoyi/cask' && contains(github.ref, 'refs/tags/') | ||
needs: publish-sonatype | ||
runs-on: ubuntu-20.04 | ||
env: | ||
LANG: "en_US.UTF-8" | ||
LC_MESSAGES: "en_US.UTF-8" | ||
LC_ALL: "en_US.UTF-8" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Generate Website | ||
run: | | ||
set -eux | ||
curl -L -o ~/amm https://github.com/lihaoyi/Ammonite/releases/download/1.1.0/2.12-1.1.0 && chmod +x ~/amm | ||
cd docs | ||
~/amm build.sc | ||
- name: Deploy Website | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/target | ||
publish_branch: gh-pages |
This file was deleted.
Oops, something went wrong.
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.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -198,13 +198,4 @@ def main(publish: Boolean = false) = { | |
) | ||
) | ||
} | ||
|
||
if (publish){ | ||
implicit val wd = cwd/'target | ||
%git 'init | ||
%git('add, "-A", ".") | ||
%git('commit, "-am", "first commit") | ||
%git('remote, 'add, 'origin, "[email protected]:lihaoyi/cask.git") | ||
%git('push, "-uf", 'origin, "master:gh-pages") | ||
} | ||
} |