• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Release
2
3on:
4  push:
5    branches:
6      - main
7    tags:
8      - '**'
9
10env:
11  GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
12
13jobs:
14  publish:
15    runs-on: ubuntu-latest
16    if: github.repository == 'square/kotlinpoet'
17
18    steps:
19      - name: Checkout
20        uses: actions/checkout@v4
21
22      - name: Configure JDK
23        uses: actions/setup-java@v4
24        with:
25          distribution: 'zulu'
26          java-version: 19
27
28      - name: Upload Artifacts
29        run: ./gradlew publish
30        env:
31          ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
32          ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
33          ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
34
35      - name: Prep docs
36        run: ./gradlew dokkaHtml
37
38      - name: Set up Python
39        uses: actions/setup-python@v5
40        with:
41          python-version: 3.8
42
43      - name: Build mkdocs
44        run: |
45          pip3 install -r .github/workflows/mkdocs-requirements.txt
46          mkdocs build
47
48      - name: Deploy ��
49        if: success()
50        uses: JamesIves/github-pages-deploy-action@releases/v3
51        with:
52          GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
53          BRANCH: gh-pages # The branch the action should deploy to.
54          FOLDER: site # The folder the action should deploy.
55          SINGLE_COMMIT: true
56