Skip to content

Commit

Permalink
github packages
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed Dec 16, 2024
1 parent 7070f4e commit 8da01f5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Maven Package

on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
java:
- 8
os:
- ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build
- name: Publish package
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ publishing {

repositories {
maven {
url = uri("https://repo.rtast.cn/api/v4/projects/38/packages/maven")
url = uri("https://maven.pkg.github.com/RTAkland/QWeatherSDK")
credentials {
username = "RTAkland"
password = System.getenv("TOKEN")
password = System.getenv("GITHUB_TOKEN")
}
}
}
Expand Down

0 comments on commit 8da01f5

Please sign in to comment.