Skip to content

Commit a5eb667

Browse files
committed
Release workflow
1 parent 1489472 commit a5eb667

File tree

1 file changed

+100
-108
lines changed

1 file changed

+100
-108
lines changed

.github/workflows/release.yml

Lines changed: 100 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
required: true
7+
required: false
88
description: Package version to publish under
99
skipPages:
1010
description: Should we skip releasing GitHub pages
@@ -69,110 +69,102 @@ jobs:
6969
path: |
7070
**/build/dokka
7171
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

Comments
 (0)