-
Notifications
You must be signed in to change notification settings - Fork 49
88 lines (85 loc) · 3.72 KB
/
checkbox-core-snap-daily-builds.yml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: checkbox core snap daily build
on:
workflow_dispatch:
workflow_call:
jobs:
check_history:
runs-on: [self-hosted, linux, large]
name: Check for new commits
outputs:
should_run: ${{ steps.check_log.outputs.should_run }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for checkbox projects new commits
id: check_log
run: |
git rev-list --abbrev-commit --pretty=oneline HEAD --not $(git rev-list -n1 --before="24 hours" --first-parent HEAD) -- checkbox-ng checkbox-support providers checkbox-core-snap checkbox-snap
changes=$(git rev-list --abbrev-commit --pretty=oneline HEAD --not $(git rev-list -n1 --before="24 hours" --first-parent HEAD) -- checkbox-ng checkbox-support providers checkbox-core-snap checkbox-snap)
if [[ -z $changes ]]
then
echo "should_run=false" >> $GITHUB_OUTPUT
else
echo "should_run=true" >> $GITHUB_OUTPUT
fi
snap:
strategy:
matrix:
releases: [16, 18, 20, 22]
arch: [amd64,arm64,armhf]
needs: check_history
if: ${{ needs.check_history.outputs.should_run != 'false' }} || github.event_name == 'workflow_dispatch'
runs-on: [self-hosted, linux, large]
env:
SERIES: series${{ matrix.releases }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
name: Runtime${{ matrix.releases }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Copy over the common files for series ${{ matrix.releases }}
run: |
cd checkbox-core-snap/
sudo apt update && sudo apt install -qq -y python3-setuptools-scm
./prepare.sh $SERIES
- name: add LP credentials
run: |
mkdir -p ~/.local/share/snapcraft/provider/launchpad/
echo '${{ secrets.LP_CREDS }}' > ~/.local/share/snapcraft/provider/launchpad/credentials
git config --global user.email "[email protected]"
git config --global user.name "Certification bot"
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Building at: https://git.launchpad.net/~ce-certification-qa/+git/checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }}
with:
action: Hook25/action-build@707dce252c4f367b6c1afe61ed577f7413cf7912
attempt_delay: 600000 # 10min
attempt_limit: 3
with: |
path: checkbox-core-snap/series${{ matrix.releases }}
snapcraft-channel: 7.x/stable
snapcraft-args: remote-build --build-on ${{ matrix.arch }} --launchpad-accept-public-upload --build-id checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: snapcraft-log-series${{ matrix.releases }}
path: |
/home/runner/.cache/snapcraft/log/
/home/runner/.local/state/snapcraft/log/
checkbox-core-snap/series${{ matrix.releases }}/checkbox*.txt
- uses: actions/upload-artifact@v3
with:
name: series${{ matrix.releases }}
path: checkbox-core-snap/series${{ matrix.releases }}/*.snap
- uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0
name: Upload checkbox core snaps to the store
with:
attempt_delay: 600000 # 10min
attempt_limit: 3
command: |
for snap in checkbox-core-snap/series${{ matrix.releases }}/*.snap ; \
do \
echo "Uploading $snap..." ; \
snapcraft upload $snap --release edge ; \
done