Skip to content

Commit debe70c

Browse files
committed
ci: Workflows updated
1 parent aab09fb commit debe70c

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build Mod .jar
22

33
on:
4+
workflow_call:
5+
46
workflow_dispatch:
57
push:
68
branches:
@@ -50,9 +52,10 @@ jobs:
5052
5153
- name: 'Save Artifact'
5254
uses: actions/upload-artifact@v4
55+
id: save-artifact
5356
with:
54-
name: 'WebSocket Console'
55-
path: ${{ github.workspace }}/build/libs
57+
name: ${{ vars.ARTIFACT_NAME }}
58+
path: ${{ github.workspace }}/build/libs/*.jar
5659

5760
dependency-submission:
5861
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}

.github/workflows/release.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,43 @@ jobs:
5252
outputs:
5353
TAG_EXISTS: ${{ steps.check-for-existing-tag.outputs.TAG_EXISTS }}
5454
VERSION: ${{ steps.get-version.outputs.VERSION }}
55-
56-
release:
55+
56+
run-build:
57+
name: 'Run build.yml'
5758
needs: check-release
5859
if: ${{ needs.check-release.outputs.TAG_EXISTS == 'FALSE' }}
60+
61+
uses: ./.github/workflows/build.yml
62+
63+
release:
64+
needs:
65+
- check-release
66+
- run-build
67+
68+
if: ${{ needs.check-release.outputs.TAG_EXISTS == 'FALSE' }}
5969
runs-on: ubuntu-latest
6070
name: Release
6171
env:
6272
VERSION: ${{ needs.check-release.outputs.VERSION }}
6373

6474
steps:
65-
- uses: actions/checkout@v4
75+
- uses: actions/download-artifact@v4
76+
with:
77+
name: ${{ vars.ARTIFACT_NAME }}
78+
path: build
6679

67-
- name: 'Draft Release'
68-
id: draft-release
80+
- name: 'Create Tag'
81+
id: create-tag
6982
uses: mathieudutour/[email protected]
7083
with:
7184
github_token: ${{ secrets.GITHUB_TOKEN }}
7285
custom_tag: ${{ env.VERSION }}
7386

74-
75-
76-
77-
87+
- name: Create a GitHub release
88+
uses: ncipollo/release-action@v1
89+
with:
90+
artifacts: "build/*.jar"
91+
makeLatest: true
92+
tag: ${{ steps.create-tag.outputs.new_tag }}
93+
name: Release ${{ steps.create-tag.outputs.new_tag }}
94+
body: ${{ steps.create-tag.outputs.changelog }}

0 commit comments

Comments
 (0)