Skip to content

Commit

Permalink
神金2
Browse files Browse the repository at this point in the history
  • Loading branch information
EarzuChan committed Aug 15, 2024
1 parent 9ecac73 commit 5ddd205
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
with:
path: temp/artifacts
- name: 原神!启动!
run: ./gradlew :uploadReleaseAssets
run: ./gradlew :uploadReleaseAssets -PpostUrl="${{ github.event.release.upload_url }}" -PghToken="${{ secrets.GITHUB_TOKEN }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POST_URL: ${{ github.event.release.upload_url }}
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ allprojects {
}

task uploadReleaseAssets {
def ghToken = System.getenv("GH_TOKEN")
def postUrl = System.getenv("POST_URL")
def ghToken = project.findProperty("ghToken") ?: "defaultToken"
def postUrl = project.findProperty("postUrl") ?: "defaultUrl"

doLast {
def artifactsDir = file('temp/artifacts').absolutePath
def version = project.version.toString()

if (ghToken == null || postUrl == null) {
throw new IllegalStateException("GH_TOKEN or POST_URL is not set.")
if (ghToken.isBlank() || postUrl.isBlank()) {
throw new IllegalArgumentException("GH_TOKEN or POST_URL is not set.")
}

def postUrlFormatted = postUrl.replaceAll("\\{.*\\}", "")
Expand Down

0 comments on commit 5ddd205

Please sign in to comment.