diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 980710b..920c6b3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -33,6 +33,8 @@ jobs: with: distribution: temurin java-version: 11 + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 - name: Setup Gradle uses: gradle/gradle-build-action@v2 - name: Build API documentation with Dokka diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d1d47c6 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish release +on: + # Runs whenever a new release is created in GitHub + release: + types: [ created ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + # Publish job + publish: + runs-on: ubuntu-latest + # Sets permissions of the GITHUB_TOKEN to allow publishing to GitHub Packages + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Publish package + uses: gradle/gradle-build-action@v2 + with: + arguments: publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 7a4e024..654c3b4 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -92,6 +92,17 @@ dependencies { } publishing { + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/THEOplayer/android-ui") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } + publications { register("release") { val libraryVersion: String by rootProject.extra