File tree Expand file tree Collapse file tree 2 files changed +35
-3
lines changed
Expand file tree Collapse file tree 2 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,41 @@ name: Build and Release Ori Launcher
33on :
44 push :
55 tags : ['v*']
6- workflow_dispatch : # Allow manual triggers
6+ workflow_dispatch :
77
88permissions :
99 contents : write
1010
1111jobs :
12+ sync-version :
13+ runs-on : ubuntu-latest
14+ if : startsWith(github.ref, 'refs/tags/')
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v4
19+
20+ - name : Sync package.json version with tag
21+ run : |
22+ # Extract version from tag (remove 'v' prefix)
23+ TAG_VERSION="${GITHUB_REF#refs/tags/v}"
24+ echo "Syncing package.json version to: $TAG_VERSION"
25+
26+ # Update package.json
27+ npm version $TAG_VERSION --no-git-tag-version --allow-same-version
28+
29+ # Verify the change
30+ echo "Updated package.json version: $(node -p "require('./package.json').version")"
31+
32+ - name : Upload updated package.json
33+ uses : actions/upload-artifact@v4
34+ with :
35+ name : updated-package
36+ path : package.json
37+ retention-days : 1
38+
1239 build-and-release :
40+ needs : sync-version
1341 strategy :
1442 matrix :
1543 include :
2856 steps :
2957 - name : Checkout code
3058 uses : actions/checkout@v4
59+
60+ - name : Download updated package.json
61+ uses : actions/download-artifact@v4
3162 with :
32- fetch-depth : 0
63+ name : updated-package
64+ path : ./
3365
3466 - name : Setup Node.js
3567 uses : actions/setup-node@v4
Original file line number Diff line number Diff line change 11{
22 "name" : " ori-launcher" ,
3- "version" : " 1.3.7 " ,
3+ "version" : " 1.3.8 " ,
44 "description" : " Modern Custom Minecraft launcher" ,
55 "author" : {
66 "name" : " Cosmic-fi (Cosmic Boucher)" ,
You can’t perform that action at this time.
0 commit comments