Skip to content

Weekly Scheduled

Weekly Scheduled #14

name: "Weekly Scheduled"
on:
schedule:
- cron: '*/5 * * * *'
jobs:
check-run:
name: Check If Weekly Test Build should be built
if: ${{ vars.ENABLED_WEEKLY != 0 }}
runs-on: ubuntu-latest
outputs:
runs-count: ${{ steps.get-info.outputs.runs-count }}
steps:
- name: Get previous builds info
id: get-info
shell: bash
run: |
echo ${{ github.token }} | gh auth login --with-token
WORKFLOW_ID=$(gh api -X GET /repos/${{ github.repository }}/actions/runs/${{ github.run_id }} --jq='.workflow_id')
TOTAL_COUNT=$(gh api -X GET "/repos/${{ github.repository }}/actions/workflows/${WORKFLOW_ID}/runs?status=success&per_page=1&head_sha=${{ github.sha }}" --jq '.total_count')
echo "Runs count: ${TOTAL_COUNT}"
echo "runs-count=${TOTAL_COUNT}" >> "$GITHUB_OUTPUT"
macos:
needs: check-run
if: ${{ needs.check-run.outputs.runs-count == 0 }}
uses: ./.github/workflows/_build-macos.yml
with:
os: 'macos-13'
weekly-deploy: true
windows:
needs: check-run
if: ${{ needs.check-run.outputs.runs-count == 0 }}
uses: ./.github/workflows/_build-windows.yml
with:
weekly-deploy: true
merge-binaries:
name: Merge binaries
runs-on: ubuntu-latest
needs: macos
steps:
- name: Merge binaries
uses: actions/upload-artifact/merge@v4
with:
name: weekly-artifact
pattern: weekly-artifacts-*
delete-merged: true
retention-days: 1
compression-level: 1