Build in Monday Every Week #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build in Monday Every Week | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1' | |
| workflow_dispatch: # 允许你手动点击按钮触发测试 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v6 | |
| - name: setup | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: chmod | |
| run: chmod +x gradlew | |
| - name: decode build key | |
| run: | | |
| echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > release-key.jks | |
| - name: build | |
| run: | | |
| ./gradlew assembleRelease \ | |
| -Pandroid.injected.signing.store.file=$(pwd)/release-key.jks \ | |
| -Pandroid.injected.signing.store.password=${{ secrets.KEYSTORE_PASSWORD }} \ | |
| -Pandroid.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} \ | |
| -Pandroid.injected.signing.key.password=${{ secrets.KEY_PASSWORD }} | |
| - name: generate build time | |
| id: time | |
| run: echo "now=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | |
| - name: upload to Actions Artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| # 下载时的压缩包名称 | |
| name: jm-mobile-weekly-${{ steps.time.outputs.now }} | |
| # 匹配生成的 APK 文件路径 | |
| path: app/build/outputs/apk/release/*.apk | |
| # 设置保留天数(可选) | |
| retention-days: 7 |