Skip to content

Commit

Permalink
setup publishing config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliaksei Trafimchyk committed Jul 6, 2023
1 parent 2e13e4c commit 3725eb8
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/build-and-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and Verify library

on:
pull_request:
branches: [ $default-branch ]

jobs:
build_and_verify:
name: Build and verify library
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.3.0

- name: set up JDK 11
uses: actions/setup-java@v3.9.0
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Build library sources
run: ./gradlew assemble

- name: Verify library sources
run: ./gradlew detektAll ktlintCheck lintRelease
49 changes: 49 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Release builds

on:
push:
tags:
- v[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]

jobs:
publish_release:
name: Release build and publish
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.3.0

- name: Set up JDK 11
uses: actions/setup-java@v3.9.0
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Release build
run: ./gradlew assemble

- name: Verify library sources
run: ./gradlew detektAll ktlintCheck lintRelease

- name: Publish to Sonatype
run: ./gradlew publishAllPublicationsToMavenCentralRepository closeAndReleaseRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
SNAPSHOT: false

- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Release ${{ github.ref }}
draft: true
prerelease: false
38 changes: 38 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Snapshot builds

on:
workflow_dispatch: # temporarily run SNAPSHOTS manually
# push:
# branches:
# - main

jobs:
publish_snapshot:
name: Snapshot build and publish
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3.3.0

- name: Set up JDK 11
uses: actions/setup-java@v3.9.0
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Snapshot build
run: ./gradlew assemble

- name: Verify library sources
run: ./gradlew detektAll ktlintCheck lintRelease

- name: Publish to Sonatype
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
SNAPSHOT: true
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ subprojects {
}

group = "net.humans.android.ui"
version = "2023.02.17"
version = "2023.07.06"

setupJavaTarget(this)
}
Expand Down

0 comments on commit 3725eb8

Please sign in to comment.