cd: optimize nightly
Add check to only run nightly if changes in the past 24 hours
This commit is contained in:
parent
e58dad00ea
commit
230f505806
|
@ -0,0 +1,20 @@
|
||||||
|
name: check-date
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_date:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Check latest commit
|
||||||
|
outputs:
|
||||||
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: print latest_commit
|
||||||
|
run: echo ${{ github.sha }}
|
||||||
|
- id: should_run
|
||||||
|
continue-on-error: true
|
||||||
|
name: check latest commit is less than a day
|
||||||
|
if: ${{ github.event_name == 'schedule' }}
|
||||||
|
run: test -z $(git rev-list --after="23 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
|
|
@ -0,0 +1,17 @@
|
||||||
|
name: nightly
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "4 3 * * *"
|
||||||
|
jobs:
|
||||||
|
nightly-publish-check:
|
||||||
|
name: Nightly publish check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: check_date
|
||||||
|
if: ${{ needs.check_date.outputs.should_run != 'false' }}
|
||||||
|
steps:
|
||||||
|
- name: Build and publish nightly
|
||||||
|
uses: ./.github/workflows/release.yml
|
||||||
|
secrets: inherit
|
||||||
|
with:
|
||||||
|
build_type: ${{ inputs.release_type == '' && 'nightly' || inputs.release_type }}
|
|
@ -1,4 +1,4 @@
|
||||||
name: Issue Updates Workflow
|
name: on-issue
|
||||||
|
|
||||||
on:
|
on:
|
||||||
issues:
|
issues:
|
||||||
|
@ -7,8 +7,8 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
on-issue:
|
||||||
name: Build
|
name: On new issue
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Send Telegram Message
|
- name: Send Telegram Message
|
|
@ -1,4 +1,4 @@
|
||||||
name: Release Updates Workflow
|
name: on-publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
|
@ -7,8 +7,8 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
on-publish:
|
||||||
name: Build
|
name: On publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Send Telegram Message
|
- name: Send Telegram Message
|
|
@ -1,8 +1,6 @@
|
||||||
name: release-android
|
name: release-android
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
|
||||||
- cron: "4 3 * * *"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
track:
|
track:
|
||||||
|
@ -34,7 +32,8 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build Signed APK
|
name: Build Signed APK
|
||||||
if: ${{ inputs.release_type != 'none' }}
|
needs: check_date
|
||||||
|
if: ${{ inputs.release_type != 'none' && (needs.check_date.outputs.should_run != 'false' && ) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|
Loading…
Reference in New Issue