11name : Release
22
33on :
4- push :
5- branches :
6- - " main"
7- paths :
8- - " CHANGELOG.md"
94 workflow_dispatch :
105
116permissions :
127 contents : write
138
149jobs :
1510 version :
11+ name : Get OpenList Version Information
1612 runs-on : ubuntu-latest
1713 outputs :
1814 version_name : ${{ steps.generate.outputs.version_name }}
3329 TIMESTAMP=$(date +%y%m%d%H)
3430 VERSION_NAME="${BASE_VERSION}.${TIMESTAMP}"
3531 echo "version_name=${VERSION_NAME}" >> $GITHUB_OUTPUT
36- echo "Generated version: ${VERSION_NAME}"
3732
3833 - name : Download OpenList Source Code
3934 run : |
6560 echo "openlist_git_commit=${OPENLIST_GIT_COMMIT}" >> $GITHUB_OUTPUT
6661 echo "openlist_web_version=${OPENLIST_WEB_VERSION}" >> $GITHUB_OUTPUT
6762 echo "openlist_built_at=${OPENLIST_BUILT_AT}" >> $GITHUB_OUTPUT
68-
69- echo "OpenList Backend Version: ${OPENLIST_VERSION}"
70- echo "OpenList Git Commit: ${OPENLIST_GIT_COMMIT}"
71- echo "OpenList Web Version: ${OPENLIST_WEB_VERSION}"
72- echo "Built At: ${OPENLIST_BUILT_AT}"
7363
7464 android :
65+ name : Build OpenList Android APK
7566 needs : [version]
7667 runs-on : ubuntu-latest
7768 env :
@@ -132,6 +123,7 @@ jobs:
132123 path : " ${{ env.output }}/*.apk"
133124
134125 # ios:
126+ # name: Build OpenList iOS App
135127 # needs: [version]
136128 # runs-on: macos-latest
137129 # env:
@@ -168,25 +160,58 @@ jobs:
168160 # cp -r Runner.app Payload/
169161 # zip -r ${{ env.output }}/OpenList-Mobile.ipa Payload/
170162
171- # - name: Verify iOS Version Consistency
172- # run: |
173- # # Use same version generated by version job
174- # echo "iOS using version: ${{ needs.version.outputs.version_name }}"
175-
176163 # - name: Upload iOS IPA for Release
177164 # uses: actions/upload-artifact@v4
178165 # with:
179166 # name: "ios-release-files"
180167 # path: "${{ env.output }}/OpenList-Mobile.ipa"
181168
182169 release :
170+ name : Create GitHub Release
183171 needs : [version, android] # Add ios when iOS build is enabled: [version, android, ios]
184172 runs-on : ubuntu-latest
185173 steps :
186174 - uses : actions/checkout@v3
187175 with :
188176 fetch-depth : 0
189177
178+ - name : Setup Node
179+ uses : actions/setup-node@v4
180+ with :
181+ node-version : " 22"
182+
183+ - name : Prepare changelog generation
184+ id : prepare_changelog
185+ run : |
186+ git tag -d rolling 2>/dev/null || true
187+ PRE_RELEASE_TAGS=$(git tag -l | grep -E "(-|\+)" || true)
188+ if [ -n "$PRE_RELEASE_TAGS" ]; then
189+ echo "$PRE_RELEASE_TAGS" | xargs -r git tag -d
190+ fi
191+
192+ - name : Generate changelog
193+ id : generate_changelog
194+ run : |
195+ npx changelogithub --output ${{ github.workspace }}/GENERATED_CHANGELOG.txt || echo "" > ${{ github.workspace }}/GENERATED_CHANGELOG.txt
196+
197+ - name : Create final changelog
198+ id : create_changelog
199+ run : |
200+ echo "[Auto Sync OpenList] ${{ needs.version.outputs.openlist_version }}" > ${{ github.workspace }}/FINAL_CHANGELOG.txt
201+ echo "" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
202+ echo "**OpenList Backend:** ${{ needs.version.outputs.openlist_version }} (${{ needs.version.outputs.openlist_git_commit }})" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
203+ echo "**OpenList Frontend:** ${{ needs.version.outputs.openlist_web_version }}" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
204+ echo "**Built at:** ${{ needs.version.outputs.openlist_built_at }}" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
205+ echo "" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
206+ echo "---" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
207+ echo "" >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
208+
209+ if [ -s "${{ github.workspace }}/GENERATED_CHANGELOG.txt" ]; then
210+ cat ${{ github.workspace }}/GENERATED_CHANGELOG.txt >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
211+ else
212+ echo "No changes in this release." >> ${{ github.workspace }}/FINAL_CHANGELOG.txt
213+ fi
214+
190215 - name : Download Android artifacts
191216 uses : actions/download-artifact@v4
192217 with :
@@ -203,7 +228,7 @@ jobs:
203228 with :
204229 name : ${{ needs.version.outputs.version_name }}
205230 tag_name : ${{ needs.version.outputs.version_name }}
206- body_path : ${{ github.workspace }}/CHANGELOG.md
231+ body_path : ${{ github.workspace }}/FINAL_CHANGELOG.txt
207232 draft : false
208233 prerelease : false
209234 files : release_files/*
0 commit comments