forked from rockcrafters/java-rockcraft-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from vpa1977/github-publish
chore: add github packages publication
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy to github | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 5 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '8' | ||
server-id: central | ||
server-username: ${{ secrets.GITHUB_USERNAME }} | ||
server-password: MAVEN_CENTRAL_TOKEN | ||
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
- name: Setup LXD | ||
uses: canonical/setup-lxd@main | ||
with: | ||
channel: 5.21/candidate | ||
|
||
- name: Install rockcraft | ||
run: | | ||
sudo snap install rockcraft --classic | ||
- name: Publish to Github Packages | ||
id: deploy | ||
run: | | ||
./gradlew publish | ||
shell: bash | ||
env: | ||
GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPO: $${ secrets.GITHUB_REPO }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
allprojects { | ||
version = "0.2.1" | ||
group = "io.github.rockcrafters" | ||
apply(plugin = "maven-publish") | ||
plugins.withType<MavenPublishPlugin>().configureEach { | ||
extensions.configure<PublishingExtension>() { | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = uri(System.getenv("GITHUB_REPO") ?: "") | ||
credentials { | ||
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USERNAME") | ||
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |