chore #406
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: update | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update: | |
name: EAS Update | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check for EXPO_TOKEN | |
run: | | |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then | |
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions" | |
exit 1 | |
fi | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: npm | |
- name: Setup EAS | |
uses: expo/expo-github-action@v8 | |
with: | |
eas-version: latest | |
token: ${{ secrets.EXPO_TOKEN }} | |
- name: Install dependencies | |
run: npm install --force | |
- name: Set up environment variables | |
run: echo "EAS_BUILD_GIT_COMMIT_HASH=${{ github.sha }}" >> $GITHUB_ENV | |
- name: Publish update | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
run: npm run update | |
- name: Send failed message to wx | |
env: | |
WX_PUSHER_TOKEN: ${{ secrets.WX_PUSHER_TOKEN }} | |
WX_PUSHER_UID: ${{ secrets.WX_PUSHER_UID }} | |
WX_PUSHER_APPID: ${{ secrets.WX_PUSHER_APPID }} | |
if: ${{ failure() }} | |
run: | | |
run_no=${{ github.run_number }} | |
run_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
curl 'https://wxpusher.zjiecode.com/api/send/message' \ | |
-X POST \ | |
-H 'Accept: */*' \ | |
-H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \ | |
-H 'Cache-Control: no-cache' \ | |
-H 'Content-Type: application/json;charset=utf-8' \ | |
-H 'Pragma: no-cache' \ | |
--data-raw '{"appId":"'"$WX_PUSHER_APPID"'","appToken":"'"$WX_PUSHER_TOKEN"'","uids":["'"$WX_PUSHER_UID"'"],"topicIds":[],"url":"'"$run_url"'","summary":"MiniBili热更新失败:#'"$run_no"'","content":"<p>#'"$run_no"'运行失败</p>","contentType":2,"verifyPay":false}' \ | |
--compressed |