-
Notifications
You must be signed in to change notification settings - Fork 37
63 lines (55 loc) · 1.84 KB
/
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
name: Builds
on:
push:
branches:
- 4.0-candidate
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lxd-migrate:
name: Test lxd-migrate build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.18.x
- name: Test lxd-migrate build
run: |
set -eux
cd ~/work/lxd-pkg-snap/lxd-pkg-snap/lxd-migrate
CGO_ENABLED=0 go build -v -tags netgo
snap:
name: Trigger snap build
needs: lxd-migrate
runs-on: ubuntu-24.04
if: ${{ github.repository == 'canonical/lxd-pkg-snap' && github.actor != 'dependabot[bot]' }}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
PACKAGE: "lxd"
REPO: "git+ssh://[email protected]/~canonical-lxd/lxd"
BRANCH: ${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: canonical/lxd/.github/actions/lp-snap-build@main
with:
ssh-key: "${{ secrets.LAUNCHPAD_LXD_BOT_KEY}}"
- name: Trigger Launchpad snap build
run: |
set -eux
localRev="$(git rev-parse HEAD)"
# XXX: `originVer` contains an array with the 2 versions
originVer=($(lxd-snapcraft -package "${PACKAGE}" -get-version -file snapcraft.yaml))
rsync -a --exclude .git --delete . ~/"${PACKAGE}-pkg-snap-lp"/
cd ~/"${PACKAGE}-pkg-snap-lp"
lxd-snapcraft -package lxd -set-version "${originVer[0]}-${localRev:0:7}" -set-source-commit ""
git add --all
git commit --all --quiet -s --allow-empty -m "Automatic upstream build (${BRANCH})" -m "Upstream commit: ${localRev}"
git show
git push --quiet