Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit fd0541f

Browse files
committed
Okay, very cool.
1 parent 026ce7f commit fd0541f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020
if: |
2121
!contains(github.event.head_commit.message, '[ci skip]')
22+
outputs:
23+
version_info: ${{ steps.get_version.outputs.version_info }}
24+
version_plain: ${{ steps.get_version.outputs.version_plain }}
25+
game_versions: ${{ steps.get_version.outputs.game_versions }}
2226
steps:
2327
- name: checkout repository
2428
uses: actions/[email protected]
@@ -35,10 +39,11 @@ jobs:
3539
- name: build
3640
run: ./gradlew build
3741
- name: get version #https://stackoverflow.com/questions/71089787/how-to-get-version-name-from-android-gradle-file-in-github-actions
42+
id: get_version
3843
run: |
39-
echo "VERSION_INFORMATION=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_ENV
40-
echo "VERSION_PLAIN=$(${{github.workspace}}/gradlew -q printVersion)" >> $GITHUB_ENV
41-
echo "GAME_VERSIONS=$(${{github.workspace}}/gradlew -q printGameVersions)" >> $GITHUB_ENV
44+
echo "version_info=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_OUTPUT
45+
echo "version_plain=$(${{github.workspace}}/gradlew -q printVersion)" >> $GITHUB_OUTPUT
46+
echo "game_versions=$(${{github.workspace}}/gradlew -q printGameVersions)" >> $GITHUB_OUTPUT
4247
- name: capture build artifacts
4348
uses: actions/[email protected]
4449
with:
@@ -82,19 +87,19 @@ jobs:
8287
with:
8388
version-type: ${{ inputs.version_type }}
8489
changelog-file: CHANGELOG.md
85-
name: ${{ env.VERSION_INFORMATION }}
86-
version: ${{ env.VERSION_PLAIN }}
90+
name: ${{ needs.build.outputs.version_info }}
91+
version: ${{ needs.build.outputs.version_plain }}
8792

8893
game-versions: |
89-
${{ env.GAME_VERSIONS }}
94+
${{ needs.build.outputs.game_versions }}
9095
9196
loaders: |
9297
fabric
9398
9499
java: |
95100
17
96101
97-
github-tag: v${{ env.VERSION_PLAIN }}
102+
github-tag: v${{ needs.build.outputs.version_plain }}
98103
github-token: ${{ secrets.GITHUB_TOKEN }}
99104
github-commitish: ${{ github.sha }}
100105
github-prerelease: false

0 commit comments

Comments
 (0)