Skip to content

Commit 95cf2af

Browse files
authored
.
1 parent 4e28e12 commit 95cf2af

File tree

1 file changed

+38
-26
lines changed

1 file changed

+38
-26
lines changed

.github/workflows/release-ci.yml

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ jobs:
101101

102102
build:
103103
runs-on: ubuntu-latest
104-
needs: spoofed-build
104+
outputs:
105+
apk_path: ${{ steps.find_apk.outputs.APK_PATH }}
106+
mapping_path: ${{ steps.normal_mapping.outputs.MAPPING_PATH }}
105107
steps:
106108
- name: Parse input
107109
run: echo "BUILD_TYPE_CASED=$(echo '${{ inputs.buildType }}' | sed 's/^\(.*\)$/\L\1/')" >> $GITHUB_ENV
@@ -131,13 +133,36 @@ jobs:
131133
id: find_apk
132134
run: |
133135
APK_PATH=$(find app/build/outputs/apk/${{ env.BUILD_TYPE_CASED }} -name "*.apk" | head -n 1)
134-
echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV
136+
echo "APK_PATH=$APK_PATH" >> $GITHUB_OUTPUT
135137
136138
- name: Find mapping file
137139
id: normal_mapping
138140
run: |
139141
MAPPING_PATH=$(find app/build/outputs/mapping/${{ env.BUILD_TYPE_CASED }} -name "mapping.txt" | head -n 1)
140-
echo "MAPPING_PATH=$MAPPING_PATH" >> $GITHUB_ENV
142+
echo "MAPPING_PATH=$MAPPING_PATH" >> $GITHUB_OUTPUT
143+
144+
- name: Upload normal mapping as artifact
145+
uses: actions/upload-artifact@v4.6.2
146+
with:
147+
name: mapping
148+
path: ${{ steps.normal_mapping.outputs.MAPPING_PATH }}
149+
150+
- name: Upload normal apk as artifact
151+
if: success() && github.ref == 'refs/heads/master'
152+
uses: actions/upload-artifact@v4.6.2
153+
with:
154+
name: ${{ steps.release-name.outputs.name }}
155+
path: app/build/outputs/apk/${{ env.BUILD_TYPE_CASED }}/*.apk
156+
157+
release:
158+
runs-on: ubuntu-latest
159+
needs: [ build, spoofed-build ]
160+
steps:
161+
- name: Parse input
162+
run: echo "BUILD_TYPE_CASED=$(echo '${{ inputs.buildType }}' | sed 's/^\(.*\)$/\L\1/')" >> $GITHUB_ENV
163+
164+
- name: Checkout
165+
uses: actions/checkout@v4.2.2
141166

142167
- name: Get commit info and build timestamp
143168
id: meta
@@ -154,19 +179,19 @@ jobs:
154179
with:
155180
to-who: '@MMRLCI'
156181
message: |-
157-
${{ inputs.title }}
158-
#ci_${{ env.VERSION }}
182+
${{ inputs.title }}
183+
#ci_${{ env.VERSION }}
159184
160-
Build on ${{ env.BUILD_DATE }}.
185+
Build on ${{ env.BUILD_DATE }}.
161186
162-
**What's new?**
187+
**What's new?**
163188
164-
${{ inputs.message }}
189+
${{ inputs.message }}
165190
166-
Type: ${{ env.BUILD_TYPE_CASED }}
167-
[Workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
191+
Type: ${{ env.BUILD_TYPE_CASED }}
192+
[Workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
168193
files: |
169-
${{ env.APK_PATH }}
194+
${{ needs.build.outputs.apk_path }}
170195
${{ needs.spoofed-build.outputs.spoofed_apk_path }}
171196
env:
172197
API_ID: ${{ secrets.API_ID }}
@@ -212,7 +237,7 @@ jobs:
212237
uses: actions/upload-release-asset@v1
213238
with:
214239
upload_url: ${{ steps.create_release.outputs.upload_url }}
215-
asset_path: ${{ env.APK_PATH }}
240+
asset_path: ${{ needs.build.outputs.apk_path }}
216241
asset_name: normal.apk
217242
asset_content_type: application/vnd.android.package-archive
218243
env:
@@ -234,7 +259,7 @@ jobs:
234259
uses: actions/upload-release-asset@v1
235260
with:
236261
upload_url: ${{ steps.create_release.outputs.upload_url }}
237-
asset_path: ${{ env.MAPPING_PATH }}
262+
asset_path: ${{ needs.build.outputs.mapping_path }}
238263
asset_name: mapping.txt
239264
asset_content_type: text/plain
240265
env:
@@ -251,19 +276,6 @@ jobs:
251276
env:
252277
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253278

254-
- name: Upload normal mapping as artifact
255-
uses: actions/upload-artifact@v4.6.2
256-
with:
257-
name: mapping
258-
path: ${{ env.MAPPING_PATH }}
259-
260-
- name: Upload normal apk as artifact
261-
if: success() && github.ref == 'refs/heads/master'
262-
uses: actions/upload-artifact@v4.6.2
263-
with:
264-
name: ${{ steps.release-name.outputs.name }}
265-
path: app/build/outputs/apk/${{ env.BUILD_TYPE_CASED }}/*.apk
266-
267279
playstore-build:
268280
runs-on: ubuntu-latest
269281
if: github.event.inputs.send_playstore == 'true'

0 commit comments

Comments
 (0)