forked from CriticalRange/vulkanmod-extra
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (97 loc) · 4.14 KB
/
release.yml
File metadata and controls
115 lines (97 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Create Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-24.04
permissions:
contents: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'microsoft'
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: false
- name: Build all versions
run: ./gradlew buildAllVersions
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Check for manual changelog
id: changelog
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
# Check if there's a manual CHANGELOG.md or RELEASE_NOTES.md
if [ -f "CHANGELOG.md" ]; then
echo "Using manual CHANGELOG.md"
cp CHANGELOG.md release_notes.md
elif [ -f "RELEASE_NOTES.md" ]; then
echo "Using manual RELEASE_NOTES.md"
cp RELEASE_NOTES.md release_notes.md
else
echo "No manual changelog found, generating simple changelog"
# Simple changelog generation
if [ -z "$LAST_TAG" ]; then
COMMITS=$(git log --oneline --pretty=format:"• %s" HEAD | head -20)
else
COMMITS=$(git log --oneline --pretty=format:"• %s" $LAST_TAG..HEAD)
fi
cat > release_notes.md << EOF
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${LAST_TAG:-HEAD}...$VERSION
## $VERSION
### Changes:
$COMMITS
### Compatibility:
• **Minecraft**: 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5
• **Fabric Loader**: 0.17.2+
• **Fabric API**: Version-specific for each Minecraft version
• **VulkanMod**: 0.5.5+
EOF
fi
echo "CHANGELOG_PATH=release_notes.md" >> $GITHUB_OUTPUT
- name: Create GitHub Draft Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
name: VulkanMod Extra ${{ steps.get_version.outputs.VERSION }}
body_path: ${{ steps.changelog.outputs.CHANGELOG_PATH }}
files: |
build/releases/*.jar
draft: true # Creates as draft - you manually publish later
prerelease: ${{ contains(steps.get_version.outputs.VERSION, 'alpha') || contains(steps.get_version.outputs.VERSION, 'beta') || contains(steps.get_version.outputs.VERSION, 'rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Display publishing instructions
run: |
echo "## 🚀 Release ${{ steps.get_version.outputs.VERSION }} is Ready for Publishing!"
echo ""
echo "**Status:** ✅ Build completed successfully, draft release created"
echo ""
echo "### 📦 Publishing Options:"
echo ""
echo "**Option 1: GitHub Only**"
echo "1. Go to https://github.com/${{ github.repository }}/releases"
echo "2. Edit the draft release"
echo "3. Click 'Publish release'"
echo ""
echo "**Option 2: Automated Publishing**"
echo "Create a GitHub issue with label 'release' and comment:"
echo "- /publish-full - Publish to all platforms"
echo "- /publish-modrinth - Publish to GitHub + Modrinth"
echo "- /publish-github - Just publish the GitHub draft"
echo ""
echo "Draft release created successfully! 🎉"
# NOTE: Platform publishing is now removed from automatic workflow
# It will be triggered by manual commands through the publish workflow