-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow exporting Nexus repository IDs and publishing artifacts t…
…o an open Nexus staging repository (#471) * feat: use an existing staging repository defined as a gradle property, otherwise create a new one * style: remove unused import * feat: declare as step output the staging repository id * docs: document the multi-stage upload feature * feat: write to file all the staging repository ids * ci: test if the file containing all the staging repo ids is created when a new staging repo is opened * docs: update readme according to the new plugin usage * docs: fix description * test: test if file exists and match the regex * test: fix bash quotes and other minor improvements
- Loading branch information
1 parent
8aac450
commit 5faaaf8
Showing
4 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ jobs: | |
) | ||
echo "Scripts update line: \"$USES\"" | ||
echo "Computed version: \"${USES#*@}\"" | ||
echo "::set-output name=version::${USES#*@}" | ||
echo "version=${USES#*@}" >> $GITHUB_OUTPUT | ||
- name: Checkout Alchemist ${{ steps.alchemist.outputs.version }} | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -94,7 +94,7 @@ jobs: | |
) | ||
echo "Scripts update line: \"$USES\"" | ||
echo "Computed version: \"${USES#*@}\"" | ||
echo "::set-output name=version::${USES#*@}" | ||
echo "version=${USES#*@}" >> $GITHUB_OUTPUT | ||
- name: Checkout Template-for-Kotlin-Multiplatform-Projects ${{ steps.versiontrick.outputs.version }} | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -121,6 +121,54 @@ jobs: | |
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
signing-key: ${{ secrets.SIGNING_KEY }} | ||
signing-password: ${{ secrets.SIGNING_PASSWORD }} | ||
test-multi-stage-deployment: | ||
runs-on: ubuntu-latest | ||
if: >- | ||
!github.event.repository.fork | ||
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) | ||
steps: | ||
- name: Compute the version of the target test project | ||
id: versiontrick | ||
shell: bash | ||
run: | | ||
# Idea: the regex matcher of Renovate keeps this string up to date automatically | ||
# The version is extracted and used to access the correct version of the scripts | ||
USES=$(cat <<TRICK_RENOVATE | ||
- uses: DanySK/[email protected] | ||
TRICK_RENOVATE | ||
) | ||
echo "Scripts update line: \"$USES\"" | ||
echo "Computed version: \"${USES#*@}\"" | ||
echo "version=${USES#*@}" >> $GITHUB_OUTPUT | ||
- name: Checkout Template-for-Kotlin-Multiplatform-Projects ${{ steps.versiontrick.outputs.version }} | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: '0' | ||
path: 'kt-mp-multi-stage' | ||
ref: "${{ steps.versiontrick.outputs.version }}" | ||
repository: 'DanySK/Template-for-Kotlin-Multiplatform-Projects' | ||
submodules: 'recursive' | ||
- name: Checkout publish-on-central | ||
uses: actions/[email protected] | ||
with: | ||
path: 'publish-on-central' | ||
- name: Dry-deploy | ||
uses: DanySK/[email protected] | ||
with: | ||
build-command: true | ||
check-command: true | ||
deploy-command: | | ||
COMMAND='./gradlew --include-build ../publish-on-central createStagingRepositoryOnMavenCentral --parallel' | ||
$(echo "$COMMAND") || $(echo "$COMMAND") || $(echo "$COMMAND") | ||
[[ -e build/staging-repo-ids.properties ]] | ||
[[ "$(wc -l build/staging-repo-ids.properties)" =~ "^1 .*" ]] | ||
[[ "$(cat build/staging-repo-ids.properties)" =~ '^MavenCentral=\w+-\d+$' ]] | ||
working-directory: kt-mp-multi-stage | ||
should-run-codecov: false | ||
should-deploy: true | ||
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | ||
signing-key: ${{ secrets.SIGNING_KEY }} | ||
signing-password: ${{ secrets.SIGNING_PASSWORD }} | ||
release: | ||
needs: | ||
- build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters