Skip to content

Commit

Permalink
Merge pull request #2 from stefan2904/patch-deploy-github
Browse files Browse the repository at this point in the history
CI: Deploy all tagged commits to Github Package Registry
  • Loading branch information
amberin authored Jan 3, 2024
2 parents c37342d + e3c8f71 commit 014fbfe
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 15 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy

on:
push:
tags:
- 'v*.*.*'

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2

- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- 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 }}
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build & Test

on:
pull_request:
branches:
- '*'
push:
branches:
- '*'

jobs:
build:
name: Build & Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'

- name: Run Tests
run: ./gradlew test --info

27 changes: 12 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ publishing {
mavenJava(MavenPublication) {
from components.java

groupId = 'com.orgzly'
groupId = 'com.orgzlyrevived'
artifactId = 'org-java'
version = VERSION_NAME

pom {
name = 'org-java'
description = 'Org files parser and generator'
url = 'https://github.com/orgzly/org-java'
url = 'https://github.com/orgzly-revived/org-java'

scm {
url = "http://github.com/orgzly/org-java"
connection = "scm:git:http://github.com/orgzly/org-java.git"
developerConnection = "scm:git:[email protected]:orgzly/org-java.git"
url = "http://github.com/orgzly-revived/org-java"
connection = "scm:git:http://github.com/orgzly-revived/org-java.git"
developerConnection = "scm:git:[email protected]:orgzly-revived/org-java.git"
}

licenses {
Expand All @@ -66,19 +66,16 @@ publishing {

repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'

url = isReleaseBuild() ? releasesRepoUrl : snapshotsRepoUrl

name = "GitHubPackages"
url = "https://maven.pkg.github.com/" + System.getenv("GITHUB_REPOSITORY")
credentials {
username = ossrhUsername
password = ossrhPassword
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

signing {
sign publishing.publications.mavenJava
}
//signing {
// sign publishing.publications.mavenJava
//}

0 comments on commit 014fbfe

Please sign in to comment.