Skip to content

Commit

Permalink
chore: publish artifacts to GitHub Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
notmeta committed Apr 24, 2024
1 parent 8ef3ef0 commit f1c1dce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
on: push
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/cache@v3
with:
path: ~/.ssh/known_hosts
key: ssh-known-hosts
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
Expand All @@ -17,18 +18,9 @@ jobs:
- uses: gradle/gradle-build-action@v2
with:
arguments: build
- if: github.ref == 'refs/heads/master'
run: |
install -dm0700 ~/.ssh
touch ~/.ssh/id_ed25519
chmod 0600 ~/.ssh/id_ed25519
echo "${SSH_KEY}" > ~/.ssh/id_ed25519
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
- if: github.ref == 'refs/heads/master'
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
ORG_GRADLE_PROJECT_openrs2Username: ${{ secrets.REPO_USERNAME }}
ORG_GRADLE_PROJECT_openrs2Password: ${{ secrets.REPO_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 6 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,13 @@ configure(subprojects.filter { it.isFree }) {
configure<PublishingExtension> {
repositories {
maven {
name = "openrs2"
url = if (version.toString().endsWith("-SNAPSHOT")) {
uri("https://repo.openrs2.org/repository/openrs2-snapshots")
} else {
uri("https://repo.openrs2.org/repository/openrs2")
}
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/blurite/openrs2")

credentials(PasswordCredentials::class)
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}

Expand Down

0 comments on commit f1c1dce

Please sign in to comment.