-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aliaksei Trafimchyk
committed
Jul 6, 2023
1 parent
2e13e4c
commit 3725eb8
Showing
4 changed files
with
114 additions
and
1 deletion.
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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 |
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