|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +# Based on Apache Arrow's java-nightly workflow |
| 19 | +# https://github.com/apache/arrow/blob/master/.github/workflows/java_nightly.yml |
| 20 | +name: Publish 1.3 documentation |
| 21 | + |
| 22 | +on: |
| 23 | + workflow_dispatch: |
| 24 | + |
| 25 | +permissions: |
| 26 | + contents: read |
| 27 | + |
| 28 | +jobs: |
| 29 | + publish: |
| 30 | + name: Publish 1.3 docs |
| 31 | + runs-on: ubuntu-22.04 |
| 32 | + if: github.repository == 'apache/pekko' |
| 33 | + steps: |
| 34 | + # TODO we will need to change to use a release tag in future |
| 35 | + - name: Checkout |
| 36 | + uses: actions/checkout@v5 |
| 37 | + with: |
| 38 | + fetch-depth: 0 |
| 39 | + fetch-tags: true |
| 40 | + persist-credentials: false |
| 41 | + ref: 1.3.x |
| 42 | + |
| 43 | + - name: Setup Java 11 |
| 44 | + uses: actions/setup-java@v5 |
| 45 | + with: |
| 46 | + distribution: temurin |
| 47 | + java-version: 11 |
| 48 | + |
| 49 | + - name: Install sbt |
| 50 | + uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1.1.14 |
| 51 | + |
| 52 | + - name: Cache Coursier cache |
| 53 | + uses: coursier/cache-action@bebeeb0e6f48ebad66d3783946588ecf43114433 # 6.4.8 |
| 54 | + |
| 55 | + - name: Install Graphviz |
| 56 | + run: |- |
| 57 | + sudo apt-get install graphviz |
| 58 | +
|
| 59 | + # TODO come up with a better way to control the version, possibly based on git tags |
| 60 | + - name: Build Documentation |
| 61 | + env: |
| 62 | + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} |
| 63 | + run: |- |
| 64 | + sbt -Dpekko.genjavadoc.enabled=true "set ThisBuild / version := \"1.3.0\"; docs/paradox; unidoc" |
| 65 | +
|
| 66 | + # Create directory structure upfront since rsync does not create intermediate directories otherwise |
| 67 | + - name: Create directory structure |
| 68 | + run: |- |
| 69 | + mkdir -p target/nightly-docs/docs/pekko/1.3.0/ |
| 70 | + mkdir -p target/nightly-docs/docs/pekko/1.3/ |
| 71 | + cp -r docs/target/paradox/site/main/ target/nightly-docs/docs/pekko/1.3.0/docs |
| 72 | + cp -r docs/target/paradox/site/main/ target/nightly-docs/docs/pekko/1.3/docs |
| 73 | + rm -r docs/target/paradox/site/main/ |
| 74 | + cp -r target/scala-2.13/unidoc target/nightly-docs/docs/pekko/1.3.0/api |
| 75 | + cp -r target/scala-2.13/unidoc target/nightly-docs/docs/pekko/1.3/api |
| 76 | + rm -r target/scala-2.13/unidoc |
| 77 | + cp -r target/javaunidoc target/nightly-docs/docs/pekko/1.3.0/japi |
| 78 | + cp -r target/javaunidoc target/nightly-docs/docs/pekko/1.3/japi |
| 79 | + rm -r target/javaunidoc |
| 80 | +
|
| 81 | + - name: Upload docs patch version |
| 82 | + uses: ./.github/actions/sync-nightlies |
| 83 | + with: |
| 84 | + upload: true |
| 85 | + switches: --archive --compress --update --delete --progress --relative |
| 86 | + local_path: target/nightly-docs/./docs/pekko/1.3.0 # The intermediate dot is to show `--relative` which paths to operate on |
| 87 | + remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/pekko |
| 88 | + remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} |
| 89 | + remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} |
| 90 | + remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} |
| 91 | + remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} |
| 92 | + |
| 93 | + - name: Upload docs api version |
| 94 | + uses: ./.github/actions/sync-nightlies |
| 95 | + with: |
| 96 | + upload: true |
| 97 | + switches: --archive --compress --update --delete --progress --relative |
| 98 | + local_path: target/nightly-docs/./docs/pekko/1.3 # The intermediate dot is to show `--relative` which paths to operate on |
| 99 | + remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/pekko |
| 100 | + remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} |
| 101 | + remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} |
| 102 | + remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} |
| 103 | + remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} |
0 commit comments