Skip to content

Commit

Permalink
Merge pull request #10 from THEOplayer/publish-to-gh-packages
Browse files Browse the repository at this point in the history
Publish to GitHub Packages
  • Loading branch information
MattiasBuelens authored Apr 5, 2023
2 parents 5f8d62a + 86798b9 commit fb65f9a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
11 changes: 11 additions & 0 deletions ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MavenPublication>("release") {
val libraryVersion: String by rootProject.extra
Expand Down

0 comments on commit fb65f9a

Please sign in to comment.