Skip to content

Commit

Permalink
ci: add publish workflow (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
aripiprazole authored Aug 4, 2023
1 parent 295e6d1 commit c4a7b26
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: Publish package
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 13 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.net.URI

plugins {
kotlin("jvm") version "1.8.21"
kotlin("plugin.serialization") version "1.8.21"
Expand All @@ -8,7 +10,7 @@ plugins {
}

group = "br.com.openpix"
version = "1.0-SNAPSHOT"
version = "0.0.1"

repositories {
mavenCentral()
Expand Down Expand Up @@ -71,6 +73,16 @@ publishing {
artifact(sources.get())
}
}
repositories {
maven {
name = "GitHubPackages"
url = URI.create("https://maven.pkg.github.com/octocat/hello-world")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

tasks.test {
Expand Down

0 comments on commit c4a7b26

Please sign in to comment.