|
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | version: |
7 | | - required: true |
| 7 | + required: false |
8 | 8 | description: Package version to publish under |
9 | 9 | skipPages: |
10 | 10 | description: Should we skip releasing GitHub pages |
@@ -69,110 +69,102 @@ jobs: |
69 | 69 | path: | |
70 | 70 | **/build/dokka |
71 | 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 }} |
| 72 | + release-Artefacts: |
| 73 | + name: Release to ${{ matrix.repository.name }} on ${{ matrix.os.runner }} |
| 74 | + runs-on: ${{ matrix.os.runner }} |
| 75 | + needs: [ check, resolve-version ] |
| 76 | + defaults: |
| 77 | + run: |
| 78 | + shell: ${{ matrix.os.shell }} |
| 79 | + env: |
| 80 | + VERSION: ${{ needs.resolve-version.outputs.version }} |
| 81 | + GH_USERNAME: ${{ github.actor }} |
| 82 | + GH_PASSWORD: ${{ github.token }} |
| 83 | + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} |
| 84 | + ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }} |
| 85 | + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} |
| 86 | + ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} |
| 87 | + ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} |
| 88 | + strategy: |
| 89 | + matrix: |
| 90 | + repository: |
| 91 | + - name: Github Packages |
| 92 | + tasks: publishAllPublicationsToGitHubRepository |
| 93 | + enabled: ${{ github.event.inputs.skipGitHub != 'y' }} |
| 94 | + - name: Maven Central |
| 95 | + # `closeSonatypeStagingRepository` Requires to manually release a new version on https://s01.oss.sonatype.org/#stagingRepositories |
| 96 | + # If you're brave, you could change it to `closeAndReleaseSonatypeStagingRepository` to fully automate the release |
| 97 | + tasks: publishToSonatype closeAndReleaseSonatypeStagingRepository |
| 98 | + enabled: ${{ github.event.inputs.skipMavenCentral != 'y' }} |
| 99 | + os: |
| 100 | + - runner: macos-latest |
| 101 | + shell: bash |
| 102 | + - runner: windows-latest |
| 103 | + shell: msys2 {0} |
| 104 | + - runner: ubuntu-latest |
| 105 | + shell: bash |
| 106 | + steps: |
| 107 | + - uses: msys2/setup-msys2@v2 |
| 108 | + if: ${{ matrix.repository.enabled == true && runner.os == 'Windows' }} |
| 109 | + with: |
| 110 | + release: false |
| 111 | + msystem: MINGW64 |
| 112 | + update: true |
| 113 | + path-type: inherit |
| 114 | + install: >- |
| 115 | + mingw-w64-x86_64-curl |
| 116 | + curl |
| 117 | +
|
| 118 | + - uses: actions/checkout@v3.0.2 |
| 119 | + if: ${{ matrix.repository.enabled == true }} |
| 120 | + |
| 121 | + - uses: actions/setup-java@v3 |
| 122 | + if: ${{ matrix.repository.enabled == true }} |
| 123 | + with: |
| 124 | + distribution: 'adopt' |
| 125 | + java-version: 11 |
| 126 | + |
| 127 | + - name: Restore Gradle cache |
| 128 | + if: ${{ matrix.repository.enabled == true }} |
| 129 | + id: cache-gradle |
| 130 | + uses: actions/cache@v3.0.5 |
| 131 | + with: |
| 132 | + path: | |
| 133 | + ~/.gradle/caches |
| 134 | + ~/.gradle/wrapper |
| 135 | + ~/.gradle/yarn |
| 136 | + ~/.gradle/nodejs |
| 137 | + ~/.konan |
| 138 | + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 139 | + restore-keys: ${{ runner.os }}-gradle- |
| 140 | + |
| 141 | + - name: Gradle Publish to ${{ matrix.repository.name }} |
| 142 | + if: ${{ matrix.repository.enabled == true }} |
| 143 | + run: ./gradlew ${{ matrix.repository.tasks }} -Pversion=${VERSION//v} --scan |
| 144 | + |
| 145 | + release-Dokka: |
| 146 | + runs-on: ubuntu-latest |
| 147 | + needs: [ build, resolve-version ] |
| 148 | + if: ${{ github.event.inputs.skipPages != 'y' }} |
| 149 | + env: |
| 150 | + VERSION: ${{ needs.resolve-version.outputs.version }} |
| 151 | + steps: |
| 152 | + - uses: actions/download-artifact@v3 |
| 153 | + with: |
| 154 | + name: dokka |
| 155 | + |
| 156 | + - name: Build Dokka Pages |
| 157 | + run: | |
| 158 | + REPO_NAME=${{ github.repository }} |
| 159 | + REPO_NAME=${REPO_NAME#${{ github.repository_owner }}/} |
| 160 | + cp -avr build/dokka/htmlMultiModule/ public; |
| 161 | + find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \; |
| 162 | + echo "/${REPO_NAME} /${REPO_NAME}/${REPO_NAME}/index.html 301" > public/_redirects; |
| 163 | + echo "/${REPO_NAME}/index.html /${REPO_NAME}/${REPO_NAME}/index.html 301" >> public/_redirects; |
| 164 | +
|
| 165 | + - uses: crazy-max/ghaction-github-pages@v3.0.0 |
| 166 | + with: |
| 167 | + target_branch: gh-pages |
| 168 | + build_dir: public |
| 169 | + env: |
| 170 | + GITHUB_TOKEN: ${{ github.token }} |
0 commit comments