Skip to content

Commit

Permalink
Migrate to GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Aug 19, 2023
1 parent 75995cd commit 3a5768d
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 89 deletions.
73 changes: 0 additions & 73 deletions .circleci/config.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: "Test and Deploy"

on:
push:
branches: [ master ]
pull_request:
release:
types:
- created

env:
JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'microsoft'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Test
run: ./gradlew check

shadow_jar:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Build JAR
run: ./gradlew shadowJar
- name: Persist JAR Artifact
uses: actions/upload-artifact@v3
with:
name: jar
path: build/libs/stellar-sdk.jar

javadoc:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Generate Documentation
run: ./gradlew javadoc
- name: Persist Documentation
uses: actions/upload-artifact@v3
with:
name: javadoc
path: javadoc

deploy:
needs: [ shadow_jar, javadoc ]
permissions:
contents: write
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download JAR Artifact
uses: actions/download-artifact@v2
with:
name: jar
path: jar
- name: Download Java Documentation
uses: actions/download-artifact@v2
with:
name: javadoc
path: javadoc
- name: Archive Documentation
run: tar -czf stellar-sdk-javadoc.tar.gz javadoc
- name: Upload artifacts to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
jar/stellar-sdk.jar
stellar-sdk-javadoc.tar.gz
- name: Upload Documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: javadoc

16 changes: 0 additions & 16 deletions after_deploy.sh

This file was deleted.

12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,16 @@ tasks.register('updateGitHook', Copy) {
rename { fileName ->
fileName.endsWith('.sh') ? fileName[0..-4] : fileName
}
}

tasks.javadoc {
destinationDir = file('javadoc')
failOnError = true
exclude("org/stellar/sdk/xdr/**")
// cast options to StandardJavadocDocletOptions
// https://docs.gradle.org/current/javadoc/org/gradle/external/javadoc/StandardJavadocDocletOptions.html
StandardJavadocDocletOptions options = options as StandardJavadocDocletOptions
options.setSplitIndex(true)
options.setMemberLevel(JavadocMemberLevel.PUBLIC)
options.setEncoding('UTF-8')
}

0 comments on commit 3a5768d

Please sign in to comment.