修改同步远端和本地的网络请求 #522
Workflow file for this run
This file contains 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: CI | |
on: | |
pull_request: | |
branches: | |
- develop | |
- alpha/* | |
workflow_dispatch: | |
jobs: | |
on_start_build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install python dependency | |
run: pip install beautifulsoup4 | |
- name: Install python requests | |
run: pip install requests | |
- name: Send lark message | |
run: python ./.github/scripts/send_lark_message.py start "$LARK_BOT_APP_ID" "$LARK_BOT_APP_SECRET" "$GITHUB_RUN_ID" "$TITLE" "$BODY" | |
env: | |
LARK_BOT_APP_ID: ${{secrets.LARK_BOT_APP_ID}} | |
LARK_BOT_APP_SECRET: ${{secrets.LARK_BOT_APP_SECRET}} | |
TITLE: ${{ github.event.pull_request.title }} | |
BODY: ${{ github.event.pull_request.body}} | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up JDK | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install python requests | |
run: pip install requests | |
- name: create secret file | |
run: python ./.github/scripts/create_secret.py "$BUGLY_APP_ID" "$SOPHIX_APP_ID" "$SOPHIX_APP_SECRET" "$SOPHIX_RSA" "$UM_APP_KEY" "$UM_PUSH_SECRET" "$UM_SHARE_SINA_APP_KEY" "$UM_SHARE_SINA_APP_SECRET" "$UM_SHARE_QQ_ZONE_APP_ID" "$UM_SHARE_QQ_ZONE_APP_SECRET" "$amap_apikey" "$RELEASE_KEY_ALIAS" "$RELEASE_KEY_PASSWORD" "$RELEASE_STORE_PASSWORD" "$KEY_CYXBS_URL" | |
env: | |
BUGLY_APP_ID: ${{secrets.BUGLY_APP_ID}} | |
SOPHIX_APP_ID: ${{secrets.SOPHIX_APP_ID }} | |
SOPHIX_APP_SECRET: ${{secrets.SOPHIX_APP_SECRET}} | |
SOPHIX_RSA: ${{secrets.SOPHIX_RSA}} | |
UM_APP_KEY: ${{secrets.UM_APP_KEY}} | |
UM_PUSH_SECRET: ${{secrets.UM_PUSH_SECRET}} | |
UM_SHARE_SINA_APP_KEY: ${{secrets.UM_SHARE_SINA_APP_KEY}} | |
UM_SHARE_SINA_APP_SECRET: ${{secrets.UM_SHARE_SINA_APP_SECRET}} | |
UM_SHARE_QQ_ZONE_APP_ID: ${{secrets.UM_SHARE_QQ_ZONE_APP_ID}} | |
UM_SHARE_QQ_ZONE_APP_SECRET: ${{secrets.UM_SHARE_QQ_ZONE_APP_SECRET}} | |
amap_apikey: ${{secrets.amap_apikey}} | |
RELEASE_KEY_ALIAS: ${{secrets.RELEASE_KEY_ALIAS}} | |
RELEASE_KEY_PASSWORD: ${{secrets.RELEASE_KEY_PASSWORD}} | |
RELEASE_STORE_PASSWORD: ${{secrets.RELEASE_STORE_PASSWORD}} | |
KEY_CYXBS_URL: ${{secrets.KEY_CYXBS_URL}} | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew assembleRelease | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: result_apk | |
path: module_app/build/outputs/apk/release/module_app-release.apk | |
retention-days: 15 | |
send_message: | |
if: always() | |
runs-on: macos-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install python dependence | |
run: pip install beautifulsoup4 | |
- name: Send lark message | |
run: python ./.github/scripts/send_lark_message.py "${{needs.build.result}}" "$LARK_BOT_APP_ID" "$LARK_BOT_APP_SECRET" "$GITHUB_RUN_ID" "$TITLE" "$BODY" | |
env: | |
LARK_BOT_APP_ID: ${{secrets.LARK_BOT_APP_ID}} | |
LARK_BOT_APP_SECRET: ${{secrets.LARK_BOT_APP_SECRET}} | |
TITLE: ${{ github.event.pull_request.title }} | |
BODY: ${{ github.event.pull_request.body }} |