Skip to content

Commit

Permalink
Merge pull request #4 from swisscom/feature/OCERED-7938-LIMA-Action-R…
Browse files Browse the repository at this point in the history
…unner-Ensure-that-ActionRunner-is-a-deployable-package

Feature/ocered 7938 lima action runner ensure that action runner is a deployable package
  • Loading branch information
SgiobairOg authored Oct 16, 2024
2 parents 75c2bb6 + 0ad4ee8 commit adf7335
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish

on:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- uses: gradle/actions/setup-gradle@v4 # v4.0.0

- name: Publish to GitHub Packages
run: ./gradlew publish -Prelease.useLastTag=true
env:
ORG_GRADLE_PROJECT_mavenPublishUser: ${{ github.actor }}
ORG_GRADLE_PROJECT_mavenPublishPassword: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
branches:
- main
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- uses: gradle/actions/setup-gradle@v4 # v4.0.0

- run: ./gradlew check

- name: Create Changelog and Tag
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.github_token }}
preset: 'conventionalcommits'
output-file: 'docs/CHANGELOG.md'
skip-version-file: 'true'

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
24 changes: 24 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,27 @@ aem {
}
}
}

publishing {
repositories {
val mavenPublishUser: String? by project
val mavenPublishPassword: String? by project
if (mavenPublishUser != null && mavenPublishPassword != null) {
maven {
name = "GitHub"
url = uri("https://maven.pkg.github.com/swisscom/JCR-Hopper")
credentials {
username = mavenPublishUser
password = mavenPublishPassword
}
}
}
}

publications {
create<MavenPublication>("hopper") {
artifact(tasks.packageCompose)
from(components["java"])
}
}
}

0 comments on commit adf7335

Please sign in to comment.