Skip to content

Commit

Permalink
修改构建脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu-ZT committed Apr 12, 2024
1 parent fdfd883 commit 901c331
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
CI_BUILD: true
steps:
- name: checkout
uses: actions/[email protected]
Expand All @@ -33,8 +35,6 @@ jobs:

- name: Build
uses: gradle/[email protected]
env:
RUN_NUMBER: ${{ vars.GITHUB_RUN_NUMBER }}
with:
arguments: build

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
CI_BUILD: true
steps:
- name: checkout
uses: actions/[email protected]
Expand All @@ -31,8 +33,6 @@ jobs:

- name: Build
uses: gradle/[email protected]
env:
RUN_NUMBER: ${{ vars.GITHUB_RUN_NUMBER }}
with:
arguments: build

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
jobs:
build:
permissions: write-all
env:
CI_BUILD: false
runs-on: ubuntu-latest
steps:
- name: checkout
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ allprojects {
group = rootProject.maven_group

// Formats the mod version to include the loader, Minecraft version, and build number (if present)
String buildNumber = System.getenv("RUN_NUMBER")
String buildNumber
if (System.getenv("CI_BUILD") == 'false') buildNumber = null
else buildNumber = System.getenv("GITHUB_RUN_NUMBER")
version = "${mod_version}" + (buildNumber != null ? "-build.${buildNumber}" : "")

repositories {
Expand Down

0 comments on commit 901c331

Please sign in to comment.