Re-implemented in Kotlin #39
Workflow file for this run
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: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Prepare | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.12.x' | |
- uses: gittools/actions/gitversion/[email protected] | |
id: gitversion | |
- name: Set version (release) | |
if: github.ref_type == 'tag' | |
run: echo "VERSION=${{steps.gitversion.outputs.semVer}}" >> $GITHUB_ENV | |
- name: Set version (pre-release) | |
if: github.ref_type != 'tag' | |
run: echo "VERSION=${{steps.gitversion.outputs.semVer}}-${{steps.gitversion.outputs.shortSha}}" >> $GITHUB_ENV | |
# Build | |
- run: gradle build | |
- run: gradle dokkaHtml | |
- run: gradle test | |
- name: Report test results | |
if: always() | |
uses: dorny/test-reporter@v1 | |
with: | |
name: Test Report | |
reporter: java-junit | |
path: '*/build/test-results/test/TEST-*.xml' | |
# Release | |
- name: Create GitHub Release | |
if: github.ref_type == 'tag' | |
uses: softprops/action-gh-release@v1 | |
# Publish | |
# - name: Publish packages (GitHub) | |
# if: github.event_name == 'push' && !startsWith(github.ref_name, 'renovate/') | |
# run: gradle publishMavenPublicationToGitHubRepository | |
# env: | |
# GITHUB_TOKEN: ${{github.token}} | |
# - name: Publish packages (Maven Central) | |
# if: github.ref_type == 'tag' | |
# run: gradle publishToSonatype closeAndReleaseSonatypeStagingRepository | |
# env: | |
# SIGNING_KEY: ${{secrets.SIGNING_KEY}} | |
# SIGNING_PASSWORD: ${{secrets.SIGNING_PASSWORD}} | |
# SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}} | |
# SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}} | |
- name: Publish documentation | |
if: github.ref_type == 'tag' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{github.token}} | |
force_orphan: true | |
publish_dir: build/dokka/html | |
cname: java.typedrest.net |