-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
4 changed files
with
122 additions
and
2 deletions.
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,37 @@ | ||
name: Publish to Maven | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
publish: | ||
if: github.repository_owner == 'viamrobotics' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
|
||
- name: Setup Java JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
|
||
- name: Build + Sign | ||
run: ./gradlew signMavenPublication | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_SIGNING_PASSWORD }} | ||
|
||
- name: Publish package | ||
run: ./gradlew publish | ||
env: | ||
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} | ||
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} |
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,77 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prepare: | ||
if: github.repository_owner == 'viamrobotics' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.which_version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Java JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v3 | ||
|
||
- name: Test | ||
run: ./gradlew test | ||
|
||
- name: Which Version | ||
id: which_version | ||
run: echo "version=$(./gradlew -q printVersion)" >> $GITHUB_OUTPUT | ||
|
||
- name: Check if release exists | ||
uses: cardinalby/[email protected] | ||
id: release_exists | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
releaseName: v${{ steps.which_version.outputs.version }} | ||
doNotFailIfNotFound: "true" | ||
|
||
- name: Cancelling - release already exists | ||
uses: andymckay/[email protected] | ||
if: steps.release_exists.outputs.id != '' | ||
|
||
- name: Build + Sign | ||
run: ./gradlew signMavenPublication | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_SIGNING_PASSWORD }} | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: | | ||
**/build/libs/* | ||
**/build/outputs/aar/* | ||
if-no-files-found: error | ||
|
||
release: | ||
needs: [ prepare ] | ||
if: github.repository_owner == 'viamrobotics' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifact | ||
merge-multiple: true | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: v${{ needs.prepare.outputs.version }} | ||
draft: true | ||
prerelease: ${{ contains(needs.prepare.outputs.version, 'SNAPSHOT') }} | ||
files: artifact/** | ||
fail_on_unmatched_files: 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
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