11name : Deploy Pre-release
22on :
3- push :
4- branches :
5- - pre-release
6- types : [closed]
73 workflow_dispatch :
4+ inputs :
5+ versionTag :
6+ description : ' Version tag'
7+ required : true
8+ type : string
9+ releaseTitle :
10+ description : ' Release title'
11+ required : true
12+ type : string
13+ releaseDescription :
14+ description : ' Release description'
15+ required : true
16+ type : string
817env :
918 DEVELOPER_DIR : /Applications/Xcode_26_beta.app
10- APP_VERSION : ' 2.8.0'
1119 SCHEME_NAME : ' EhPanda'
1220 ALTSTORE_JSON_PATH : ' ./AltStore.json'
1321 BUILDS_PATH : ' /tmp/action-builds'
1422 PAYLOAD_PATH : ' /tmp/action-builds/Payload'
15- FILTER_SWIFT_PATH : ' ./actions-tool/ReleaseNotesFilter.swift'
16- FILTER_PATH : ' ./actions-tool/ReleaseNotesFilter'
1723 THIN_PAYLOAD_SCRIPT_PATH : ' ./actions-tool/thin-payload.sh'
1824 ARCHIVE_PATH : ' /tmp/action-builds/EhPanda.xcarchive'
1925 IPA_OUTPUT_PATH : ' /tmp/action-builds/EhPanda.ipa'
2026
2127jobs :
2228 Deploy :
2329 runs-on : macos-15
24- if : |
25- github.event_name == 'workflow_dispatch' || (
26- github.event.pull_request.merged == true &&
27- (github.event.pull_request.user.login == 'aalberrty' || github.event.pull_request.user.login == 'chihchy')
28- )
30+ if : github.event_name == 'workflow_dispatch'
2931 steps :
3032 - name : Checkout
3133 uses : actions/checkout@v4
4648 id : bump-version
4749 uses : yanamura/ios-bump-version@v1
4850 with :
49- version : ${{ env.APP_VERSION }}
51+ version : ${{ inputs.versionTag }}
5052 - name : Xcode archive
5153 run : xcodebuild archive
5254 -skipMacroValidation
@@ -70,17 +72,13 @@ jobs:
7072 - name : Retrieve data
7173 id : retrieve-data
7274 run : |
73- swiftc -o $FILTER_PATH $FILTER_SWIFT_PATH
74- sudo chmod 777 $FILTER_PATH
7575 echo "size=$(stat -f%z $IPA_OUTPUT_PATH)" >> $GITHUB_OUTPUT
7676 echo "version_date=$(date -u +"%Y-%m-%dT%T")" >> $GITHUB_OUTPUT
77- echo "notes=$($FILTER_PATH "${{ github.event.pull_request.body }}")" >> $GITHUB_OUTPUT
7877 - name : Validate data
7978 run : |
80- [[ ! -z "${{ github.event.pull_request.body }}" ]] || exit 1
81- [[ ! -z "${{ github.event.pull_request.title }}" ]] || exit 1
79+ [[ ! -z "${{ inputs.releaseTitle }}" ]] || exit 1
80+ [[ ! -z "${{ inputs.releaseDescription }}" ]] || exit 1
8281 [[ ! -z "${{ steps.retrieve-data.outputs.size }}" ]] || exit 1
83- [[ ! -z "${{ steps.retrieve-data.outputs.notes }}" ]] || exit 1
8482 [[ ! -z "${{ steps.bump-version.outputs.version }}" ]] || exit 1
8583 [[ ! -z "${{ steps.retrieve-data.outputs.version_date }}" ]] || exit 1
8684 - name : Release to GitHub
9088 fail_on_unmatched_files : true
9189 files : ${{ env.IPA_OUTPUT_PATH }}
9290 token : ${{ secrets.GITHUB_TOKEN }}
93- body : ${{ github.event.pull_request.body }}
94- name : ${{ github.event.pull_request.title }}
91+ name : ${{ inputs.releaseTitle }}
92+ body : ${{ inputs.releaseDescription }}
9593 tag_name : ' v${{ steps.bump-version.outputs.version }}'
96- - name : Commit bump version
97- run : |
98- git add .
99- git commit -m "Bump version"
100- git push origin HEAD
101-
102- # - name: Post pre-release notes
103- # run: |
104- # curl https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage \
105- # -d parse_mode=markdown -d chat_id=${{ secrets.TELEGRAM_CHANNEL_ID }} \
106- # -d text='*v${{ steps.bump-version.outputs.version }} Pre-release Notes:*%0A${{ github.event.pull_request.body }}'
107-
108- # curl ${{ secrets.DISCORD_WEBHOOK }} \
109- # -F 'payload_json={"content": "**v${{ steps.bump-version.outputs.version }} Pre-release Notes:**\n${{ steps.retrieve-data.outputs.notes }}"}'
0 commit comments