Sonatype release (#149) #82
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
name: Swim Java SDK | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'swim-java/**' | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: swim-java | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- uses: gradle/wrapper-validation-action@v1 | |
- name: Compile SDK | |
run: | | |
./gradlew compileTestJava | |
- name: Generate API docs | |
run: | | |
./gradlew :javadoc | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_DOCS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_DOCS_SECRET_ACCESS_KEY }} | |
aws-region: us-west-1 | |
- name: Publish latest API docs | |
run: | | |
aws s3 sync build/docs/javadoc s3://docs.swimos.org/java/4.x | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DOCS_CLOUDFRONT_DISTRIBUTION_ID }} --paths '/java/4.x/*' |