Workflow file for this run
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
name: build and publish a release | |
on: | |
release: | |
types: [published] | |
jobs: | |
create-staging-repository: | |
uses: kosi-libs/kodein-internal-github-actions/.github/workflows/create-nexus-staging-repository.yml@main | |
secrets: inherit | |
build-upload: | |
needs: create-staging-repository | |
runs-on: ${{ matrix.os }} | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }} | |
GPG_PRIVATE_KEY: ${{ secrets.PGP_SIGNING_KEY }} | |
GPG_PRIVATE_PASSWORD: ${{ secrets.PGP_SIGNING_PASSWORD }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
steps: | |
- name: Setup | |
uses: kosi-libs/kodein-internal-github-actions/setup@main | |
# Host only for MacOS / Windows | |
- name: Check (macos / windows) | |
if: matrix.os != 'ubuntu-latest' | |
run: ./gradlew hostOnlyTest | |
shell: bash | |
- name: Upload (macos / windows) | |
if: matrix.os != 'ubuntu-latest' | |
run: ./gradlew hostOnlyPublish -Porg.kodein.sonatype.repositoryId=${{ needs.create-staging-repository.outputs.repository-id }} | |
shell: bash | |
# Linux / JVM / JS | |
- name: Check (ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: ./gradlew check | |
shell: bash | |
- name: Upload (ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: ./gradlew publishAllPublicationsToOssrhStagingRepository -Porg.kodein.sonatype.repositoryId=${{ needs.create-staging-repository.outputs.repository-id }} | |
shell: bash | |
drop-or-release-staging-repository: | |
needs: [create-staging-repository, build-upload] | |
if: ${{ always() && needs.create-staging-repository.result == 'success' }} | |
uses: kosi-libs/kodein-internal-github-actions/.github/workflows/drop-or-release-nexus-staging-repository.yml@main | |
secrets: inherit | |
with: | |
repository-id: ${{ needs.create-staging-repository.outputs.repository-id }} | |
build-upload-result: ${{ needs.build-upload.result }} |