-
Notifications
You must be signed in to change notification settings - Fork 76
65 lines (61 loc) · 2.46 KB
/
daily-builds.yml
File metadata and controls
65 lines (61 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Daily builds
permissions:
contents: read
actions: read # used by gh api
on:
schedule:
- cron: '00 18 * * *'
workflow_dispatch:
jobs:
check_for_commits:
runs-on:
group: "Canonical self-hosted runners"
labels:
- self-hosted
- linux
- jammy
- large
- X64
name: Check for commits
outputs:
new_commit_count: ${{ steps.commit_check.outputs.new_commit_count }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
persist-credentials: false
- name: Check for commits
id: commit_check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# get the last daily build that passed by
# 1. getting all workflows that are daily builds (path == ...)
# 2. removing those that did not result in success
# 3. selecting the date/time they started at (format: %Y-%m-%dT%H:%M:%sZ)
# 4. removing the Z postfix from the date to make it usable by git directly
export LAST_PASS_DAILY_BUILD=`gh api repos/canonical/checkbox/actions/runs --paginate --jq '.workflow_runs[] | select(.path == ".github/workflows/daily-builds.yml") | select(.conclusion == "success") | .run_started_at | .[:-1]' | head -1`
commit_count=$(git log --since="$LAST_PASS_DAILY_BUILD" --oneline -- checkbox-ng checkbox-support providers checkbox-core-snap checkbox-snap | wc -l)
echo "new_commit_count=$commit_count" | tee $GITHUB_OUTPUT
snap-cross-build-upload-daily:
needs: check_for_commits
if: ${{ needs.check_for_commits.outputs.new_commit_count > 0 || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/checkbox-daily-cross-builds.yaml
secrets:
SNAPCRAFT7_CREDS: ${{ secrets.SNAPCRAFT7_CREDS }}
with:
store_upload: true
snap-native-build-upload-daily:
needs: check_for_commits
if: ${{ needs.check_for_commits.outputs.new_commit_count > 0 || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/checkbox-daily-native-builds.yaml
secrets:
SNAPCRAFT7_CREDS: ${{ secrets.SNAPCRAFT7_CREDS }}
with:
store_upload: true
deb-daily:
needs: check_for_commits
if: ${{ needs.check_for_commits.outputs.new_commit_count > 0 || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/deb-daily-builds.yml
secrets:
LP_CREDS: ${{ secrets.LP_CREDS }}