diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04be02dfb..7ba1b54ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,7 +78,9 @@ jobs: files: ${{ github.workspace }}/apk/*.apk env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Push Assets To "release" Branch + if: ${{ github.actor == 'gedoor' }} run: | cd $GITHUB_WORKSPACE/apk || exit 1 git init @@ -87,11 +89,12 @@ jobs: git checkout -b release git add *.apk git commit -m "${{ env.RELEASE_VERSION }}" - git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" + git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.actor }}/release" git push -f -u origin release - name: Purge Jsdelivr Cache + if: ${{ github.actor == 'gedoor' }} run: | - result=$(curl -s https://purge.jsdelivr.net/gh/${{ github.repository }}@release/) + result=$(curl -s https://purge.jsdelivr.net/gh/${{ github.actor }}/release@release/) if echo $result |grep -q 'success.*true'; then echo "jsdelivr缓存更新成功" else diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f6441b98..c7738b502 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ on: branches: - master workflow_dispatch: - + jobs: prepare: runs-on: ubuntu-latest @@ -15,25 +15,25 @@ jobs: lanzou: ${{ steps.check.outputs.lanzou }} telegram: ${{ steps.check.outputs.telegram }} steps: - - id: set-ver - run: | - echo "::set-output name=version::$(date -d "8 hour" -u +3.%y.%m%d%H)" - echo "::set-output name=versionL::$(date -d "8 hour" -u +3.%y.%m%d%H%M)" - - id: check - run: | - if [ ${{ secrets.LANZOU_ID }} ]; then - echo "::set-output name=lanzou::yes" - fi - if [ ${{ secrets.BOT_TOKEN }} ]; then - echo "::set-output name=telegram::yes" - fi - + - id: set-ver + run: | + echo "::set-output name=version::$(date -d "8 hour" -u +3.%y.%m%d%H)" + echo "::set-output name=versionL::$(date -d "8 hour" -u +3.%y.%m%d%H%M)" + - id: check + run: | + if [ ${{ secrets.LANZOU_ID }} ]; then + echo "::set-output name=lanzou::yes" + fi + if [ ${{ secrets.BOT_TOKEN }} ]; then + echo "::set-output name=telegram::yes" + fi + build: needs: prepare strategy: matrix: - product: [app, google] - type: [release, releaseA] + product: [ app, google ] + type: [ release, releaseA ] fail-fast: false runs-on: ubuntu-latest env: @@ -91,7 +91,7 @@ jobs: path: ${{ github.workspace }}/apk/*.apk lanzou: - needs: [prepare, build] + needs: [ prepare, build ] if: ${{ needs.prepare.outputs.lanzou }} runs-on: ubuntu-latest env: @@ -115,8 +115,9 @@ jobs: echo "[$(date -u -d '+8 hour' '+%Y.%m.%d %H:%M:%S')] 分享链接: https://kunfei.lanzoux.com/b0f810h4b" test_Branch: - needs: [prepare, build] + needs: [ prepare, build ] runs-on: ubuntu-latest + if: ${{ github.actor == 'gedoor' }} steps: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 @@ -133,11 +134,11 @@ jobs: git checkout -b test git add *.apk git commit -m "${{ needs.prepare.outputs.versionL }}" - git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" + git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.actor }}/release" git push -f -u origin test telegram: - needs: [prepare, build] + needs: [ prepare, build ] if: ${{ needs.prepare.outputs.telegram }} runs-on: ubuntu-latest env: