Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改构建脚本 #258

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading