Delivery #54
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: Delivery | |
on: | |
workflow_dispatch: | |
env: | |
GRADLE_CACHE_CLEANUP: true | |
JAVA_DISTRIBUTION: temurin | |
JAVA_VERSION: 17 | |
jobs: | |
# --------------------------------- Stage 1 ---------------------------------- | |
setup: | |
name: OSSRH Setup | |
runs-on: ubuntu-latest | |
outputs: | |
repository_identifier: ${{ steps.create.outputs.repository_id }} | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Setup Java | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRIBUTION }} | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Setup Gradle | |
uses: gradle/actions/[email protected] | |
with: | |
gradle-home-cache-cleanup: ${{ env.GRADLE_CACHE_CLEANUP }} | |
- name: Detect project version | |
run: | | |
echo "PROJECT_VERSION=$(./gradlew :types:version -q)" >> "$GITHUB_ENV" | |
- name: Create staging repository | |
id: create | |
uses: nexus-actions/[email protected] | |
with: | |
username: ${{ secrets.SONATYPE_USERNAME }} | |
password: ${{ secrets.SONATYPE_PASSWORD }} | |
staging_profile_id: ${{ secrets.SONATYPE_PROFILE }} | |
base_url: https://s01.oss.sonatype.org/service/local/ | |
description: | |
Kotools Types ${{ env.PROJECT_VERSION }} (${{ github.run_number }}) | |
# --------------------------------- Stage 2 ---------------------------------- | |
delivery: | |
name: OSSRH Delivery | |
needs: setup | |
runs-on: macos-12 | |
strategy: | |
matrix: | |
project: [ types-internal, types, types-kotlinx-serialization ] | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Setup Java | |
uses: actions/[email protected] | |
with: | |
distribution: ${{ env.JAVA_DISTRIBUTION }} | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Setup Gradle | |
uses: gradle/actions/[email protected] | |
with: | |
gradle-home-cache-cleanup: ${{ env.GRADLE_CACHE_CLEANUP }} | |
- name: Deliver all publications | |
run: ./gradlew :$PROJECT:publishAllPublicationsToOSSRHRepository | |
env: | |
GIT_USER: ${{ secrets.GIT_USER }} | |
GIT_EMAIL: ${{ secrets.GIT_EMAIL }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
PROJECT: ${{ matrix.project }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_REPOSITORY_IDENTIFIER: | |
${{ needs.setup.outputs.repository_identifier }} |