-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.03 KB
/
edge.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
name: edge
on:
push:
branches:
- 'master'
workflow_dispatch:
# vergoh/vnstat triggers builds on change and once per month
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: './snap/hooks'
- name: Check spelling
uses: crate-ci/typos@master
with:
files: ./README* ./snap/*.yaml ./snap/hooks/*
isolated: true
trigger:
needs: [lint]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git remote add deploy git+ssh://[email protected]/~vergo/+git/vnstat-snap
- name: Setup ssh
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Setup git.launchpad.net as known host
env:
GIT_LAUNCHPAD_HOST: ${{ secrets.GIT_LAUNCHPAD_NET_SSH }}
run: echo "$GIT_LAUNCHPAD_HOST" >>~/.ssh/known_hosts
- name: Discover current snap commit
run: |
echo "SNAP_COMMIT=$(git rev-parse --short=1 "$GITHUB_SHA")" >>$GITHUB_ENV
- name: Setup build details for edge
shell: bash
run: |
git checkout -b edge
sed -i -e "s/::g')\"\$/::g')-$SNAP_COMMIT\"/g" snap/snapcraft.yaml
echo "# timestamp: $(date +"%F %X")" >>snap/snapcraft.yaml
git diff
git commit -a -m "GitHub $GITHUB_REPOSITORY $GITHUB_WORKFLOW #$GITHUB_RUN_NUMBER"
- name: Build test
uses: snapcore/action-build@v1
id: snapcraft
- name: Install test
run: |
sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }}
vnstat --version
- name: Push changes
run: |
git push deploy edge --force