|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + required: true |
| 8 | + description: Package version to publish under |
| 9 | + skipPages: |
| 10 | + description: Should we skip releasing GitHub pages |
| 11 | + required: false |
| 12 | + default: "y" |
| 13 | + skipMavenCentral: |
| 14 | + description: Should we skip publishing artefacts to Maven Central |
| 15 | + required: false |
| 16 | + default: "y" |
| 17 | + skipGitHub: |
| 18 | + description: Should we skip publishing artefacts to GitHub Packages |
| 19 | + required: false |
| 20 | + default: "y" |
| 21 | + release: |
| 22 | + types: [ created ] |
| 23 | + |
| 24 | +env: |
| 25 | + GRADLE_OPTS: "-Dorg.gradle.daemon=true" |
| 26 | + |
| 27 | +jobs: |
| 28 | + check: |
| 29 | + uses: ./.github/workflows/check.yml |
| 30 | + |
| 31 | + resolve-version: |
| 32 | + uses: ./.github/workflows/resolve-version.yml |
| 33 | + with: |
| 34 | + desired-version: ${{ github.event.release.tag_name | github.event.inputs.version }} |
| 35 | + |
| 36 | + build: |
| 37 | + name: Build Dokka |
| 38 | + needs: [ check, resolve-version ] |
| 39 | + runs-on: ubuntu-latest |
| 40 | + env: |
| 41 | + VERSION: ${{ needs.resolve-version.outputs.version }} |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v3 |
| 44 | + |
| 45 | + - uses: actions/setup-java@v3 |
| 46 | + with: |
| 47 | + distribution: 'adopt' |
| 48 | + java-version: 11 |
| 49 | + |
| 50 | + - name: Restore Gradle cache |
| 51 | + id: cache-gradle |
| 52 | + uses: actions/cache@v3.0.5 |
| 53 | + with: |
| 54 | + path: | |
| 55 | + ~/.gradle/caches |
| 56 | + ~/.gradle/wrapper |
| 57 | + ~/.gradle/yarn |
| 58 | + ~/.gradle/nodejs |
| 59 | + ~/.konan |
| 60 | + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 61 | + restore-keys: ${{ runner.os }}-gradle- |
| 62 | + |
| 63 | + - name: Gradle Assemble Dokka |
| 64 | + run: ./gradlew dokkaHtmlMultiModule -Pversion=${VERSION//v} --scan |
| 65 | + |
| 66 | + - uses: actions/upload-artifact@v3 |
| 67 | + with: |
| 68 | + name: dokka |
| 69 | + path: | |
| 70 | + **/build/dokka |
| 71 | +
|
| 72 | +# release-Artefacts: |
| 73 | +# name: Release to ${{ matrix.repository.name }} on ${{ matrix.os.runner }} |
| 74 | +# runs-on: ${{ matrix.os.runner }} |
| 75 | +# needs: [ check ] |
| 76 | +# defaults: |
| 77 | +# run: |
| 78 | +# shell: ${{ matrix.os.shell }} |
| 79 | +# env: |
| 80 | +# GH_USERNAME: ${{ github.actor }} |
| 81 | +# GH_PASSWORD: ${{ github.token }} |
| 82 | +# ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} |
| 83 | +# ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} |
| 84 | +# ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} |
| 85 | +# ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} |
| 86 | +# ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} |
| 87 | +# strategy: |
| 88 | +# matrix: |
| 89 | +# repository: |
| 90 | +# - name: Github Packages |
| 91 | +# tasks: publishAllPublicationsToGitHubRepository |
| 92 | +# enabled: ${{ github.event.inputs.skipGitHub != 'y' }} |
| 93 | +# - name: Maven Central |
| 94 | +# # Requires to manually release a new version on https://s01.oss.sonatype.org/#stagingRepositories |
| 95 | +# # If you're brave, you could change it to `publishToSonatype closeAndReleaseSonatypeStagingRepository` to fully automate the release |
| 96 | +# tasks: publishToSonatype closeSonatypeStagingRepository |
| 97 | +# enabled: ${{ github.event.inputs.skipMavenCentral != 'y' }} |
| 98 | +# os: |
| 99 | +# - runner: macos-latest |
| 100 | +# shell: bash |
| 101 | +# - runner: windows-latest |
| 102 | +# shell: msys2 {0} |
| 103 | +# - runner: ubuntu-latest |
| 104 | +# shell: bash |
| 105 | +# steps: |
| 106 | +# - uses: msys2/setup-msys2@v2 |
| 107 | +# if: ${{ matrix.repository.enabled == true && runner.os == 'Windows' }} |
| 108 | +# with: |
| 109 | +# release: false |
| 110 | +# msystem: MINGW64 |
| 111 | +# update: true |
| 112 | +# path-type: inherit |
| 113 | +# install: >- |
| 114 | +# mingw-w64-x86_64-curl |
| 115 | +# curl |
| 116 | +# |
| 117 | +# - uses: actions/checkout@v3.0.2 |
| 118 | +# if: ${{ matrix.repository.enabled == true }} |
| 119 | +# |
| 120 | +# - uses: actions/setup-java@v3 |
| 121 | +# if: ${{ matrix.repository.enabled == true }} |
| 122 | +# with: |
| 123 | +# distribution: 'adopt' |
| 124 | +# java-version: 11 |
| 125 | +# |
| 126 | +# - name: Restore Gradle cache |
| 127 | +# if: ${{ matrix.repository.enabled == true }} |
| 128 | +# id: cache-gradle |
| 129 | +# uses: actions/cache@v3.0.5 |
| 130 | +# with: |
| 131 | +# path: | |
| 132 | +# ~/.gradle/caches |
| 133 | +# ~/.gradle/wrapper |
| 134 | +# ~/.gradle/yarn |
| 135 | +# ~/.gradle/nodejs |
| 136 | +# ~/.konan |
| 137 | +# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 138 | +# restore-keys: ${{ runner.os }}-gradle- |
| 139 | +# |
| 140 | +# - name: Resolve Version |
| 141 | +# if: ${{ matrix.repository.enabled == true }} |
| 142 | +# run: | |
| 143 | +# VERSION=${VERSION:=${{ github.event.inputs.version }}} |
| 144 | +# echo "VERSION=${VERSION/v}" >> $GITHUB_ENV |
| 145 | +# |
| 146 | +# - name: Gradle Publish to ${{ matrix.repository.name }} |
| 147 | +# if: ${{ matrix.repository.enabled == true }} |
| 148 | +# run: ./gradlew ${{ matrix.repository.tasks }} -Pversion=${VERSION//v} --scan |
| 149 | +# |
| 150 | +# release-Dokka: |
| 151 | +# runs-on: ubuntu-latest |
| 152 | +# needs: [ build ] |
| 153 | +# if: ${{ github.event.inputs.skipPages != 'y' }} |
| 154 | +# steps: |
| 155 | +# - uses: actions/download-artifact@v3 |
| 156 | +# with: |
| 157 | +# name: dokka |
| 158 | +# |
| 159 | +# - name: Resolve Version |
| 160 | +# run: | |
| 161 | +# VERSION=${VERSION:=${{ github.event.inputs.version }}} |
| 162 | +# echo "VERSION=${VERSION/v}" >> $GITHUB_ENV |
| 163 | +# |
| 164 | +# - name: Build Dokka Pages |
| 165 | +# run: | |
| 166 | +# REPO_NAME=${{ github.repository }} |
| 167 | +# REPO_NAME=${REPO_NAME#${{ github.repository_owner }}/} |
| 168 | +# cp -avr build/dokka/htmlMultiModule/ public; |
| 169 | +# find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \; |
| 170 | +# echo "/${REPO_NAME} /${REPO_NAME}/${REPO_NAME}/index.html 301" > public/_redirects; |
| 171 | +# echo "/${REPO_NAME}/index.html /${REPO_NAME}/${REPO_NAME}/index.html 301" >> public/_redirects; |
| 172 | +# |
| 173 | +# - uses: crazy-max/ghaction-github-pages@v3.0.0 |
| 174 | +# with: |
| 175 | +# target_branch: gh-pages |
| 176 | +# build_dir: public |
| 177 | +# env: |
| 178 | +# GITHUB_TOKEN: ${{ github.token }} |
0 commit comments