Skip to content

Commit

Permalink
kotlin 1.4.31 + Maven Central publication
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Boisselle committed Feb 27, 2021
1 parent 9c8b03a commit 271976f
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 89 deletions.
109 changes: 51 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@ on:
release:
types: [published]

env:
SONATYPE_USERNAME: ${{ secrets.sonatype_username }}
SONATYPE_PASSWORD: ${{ secrets.sonatype_password }}
GPG_PRIVATE_KEY: ${{ secrets.pgp_signing_key }}
GPG_PRIVATE_PASSWORD: ${{ secrets.pgp_signing_password }}


jobs:
create-staging-repository:
name: Create staging repository
runs-on: ubuntu-latest
outputs:
repository-id: ${{ steps.create.outputs.repository-id }}
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
run: |
wget https://raw.githubusercontent.com/Kodein-Framework/kodein-internal-gradle-plugin/master/sonatype-rest-api/create-repository.sh
chmod a+x create-repository.sh
./create-repository.sh -u $SONATYPE_USERNAME -p $SONATYPE_PASSWORD -id ${{ secrets.sonatype_profile_id }}
uses: nexus-actions/[email protected]
with:
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_profile_id: ${{ secrets.SONATYPE_PROFILE_ID }}
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }}

build-upload:
needs: create-staging-repository
runs-on: ${{ matrix.os }}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.PGP_SIGNING_KEY }}
GPG_PRIVATE_PASSWORD: ${{ secrets.PGP_SIGNING_PASSWORD }}
strategy:
matrix:
os: [macOS-latest, windows-latest]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- name: Check out
uses: actions/checkout@v2
Expand All @@ -48,57 +49,49 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11
- name: Check
# Host only for MacOS / Windows
- name: Check (macos / windows)
if: matrix.os != 'ubuntu-latest'
run: ./gradlew hostOnlyTest
shell: bash
- name: Upload
run: ./gradlew hostOnlyPublish -Porg.kodein.sonatype.repositoryId=${{ needs.create-staging-repository.outputs.repository-id }}
- name: Check Android
if: matrix.os == 'macOS-latest'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
ndk: 21.3.6528147
cmake: 3.10.2.4988404
script: ./gradlew connectedCheck
- 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
- name: Discard
if: ${{ failure() || cancelled() }}
run: |
wget https://raw.githubusercontent.com/Kodein-Framework/kodein-internal-gradle-plugin/master/sonatype-rest-api/drop-repository.sh
chmod a+x drop-repository.sh
./drop-repository.sh -u $SONATYPE_USERNAME -p $SONATYPE_PASSWORD -id ${{ needs.create-staging-repository.outputs.repository-id }}
# 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
build-upload-publish:

drop-or-release:
needs: [create-staging-repository, build-upload]
runs-on: ubuntu-latest
if: ${{ always() && needs.create-staging-repository.result == 'success' }}
steps:
- name: Check out
uses: actions/checkout@v2
- name: Cached Konan
uses: actions/cache@v2
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-konan-
- name: Cached Gradle
uses: actions/cache@v2
- name: Discard
if: ${{ needs.build-upload.result != 'success' }}
uses: nexus-actions/drop-nexus-staging-repo@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up JDK 11
uses: actions/setup-java@v1
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_repository_id: ${{ needs.create-staging-repository.outputs.repository_id }}
- name: Release
if: ${{ needs.build-upload.result == 'success' }}
uses: nexus-actions/release-nexus-staging-repo@v1
with:
java-version: 11
- name: Check
run: ./gradlew check
shell: bash
- name: Upload
run: ./gradlew publish -Porg.kodein.sonatype.repositoryId=${{ needs.create-staging-repository.outputs.repository-id }}
shell: bash
- name: Discard
if: ${{ failure() || cancelled() }}
run: |
wget https://raw.githubusercontent.com/Kodein-Framework/kodein-internal-gradle-plugin/master/sonatype-rest-api/drop-repository.sh
chmod a+x drop-repository.sh
./drop-repository.sh -u $SONATYPE_USERNAME -p $SONATYPE_PASSWORD -id ${{ needs.create-staging-repository.outputs.repository-id }}
shell: bash
- name: Publish
run: |
wget https://raw.githubusercontent.com/Kodein-Framework/kodein-internal-gradle-plugin/master/sonatype-rest-api/release-repository.sh
chmod a+x release-repository.sh
./release-repository.sh -u $SONATYPE_USERNAME -p $SONATYPE_PASSWORD -id ${{ needs.create-staging-repository.outputs.repository-id }}
shell: bash
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_repository_id: ${{ needs.create-staging-repository.outputs.repository_id }}
42 changes: 13 additions & 29 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macOS-latest, windows-latest ]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- name: Check out
uses: actions/checkout@v2
Expand All @@ -42,7 +42,9 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11
- name: Check
# Host only for MacOS / Windows
- name: Check (macos / windows)
if: matrix.os != 'ubuntu-latest'
run: ./gradlew hostOnlyTest
shell: bash
- name: Check Android
Expand All @@ -53,34 +55,16 @@ jobs:
ndk: 21.3.6528147
cmake: 3.10.2.4988404
script: ./gradlew connectedCheck
- name: Upload
- name: Upload (macos / windows)
if: matrix.os != 'ubuntu-latest'
run: ./gradlew hostOnlyPublish -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }}
shell: bash
build-upload-publish:
needs: build-upload
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v2
- name: Cached Konan
uses: actions/cache@v2
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-konan-
- name: Cached Gradle
uses: actions/cache@v2
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Check
# Linux / JVM / JS
- name: Check (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: ./gradlew check
shell: bash
- name: Upload
run: ./gradlew publish -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }}
shell: bash
- name: Upload (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: ./gradlew publishAllPublicationsToOssrhStagingRepository -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }}
shell: bash
2 changes: 1 addition & 1 deletion kodein-di/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ kodein {

common {
main.dependencies {
api("org.kodein.type:kodein-type:1.5.0")
api("org.kodein.type:kodein-type:1.6.0")
}
test.dependencies {
implementation(project(":test-utils"))
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
maven(url = "https://raw.githubusercontent.com/Kodein-Framework/kodein-internal-gradle-plugin/mvn-repo")
}
dependencies {
classpath("org.kodein.internal.gradle:kodein-internal-gradle-settings:6.0.0-SNAPSHOT")
classpath("org.kodein.internal.gradle:kodein-internal-gradle-settings:6.1.0")
}
}

Expand Down

0 comments on commit 271976f

Please sign in to comment.