Skip to content

github: s/lxd/${PACKAGE}/ in snap build step (#665) #1210

github: s/lxd/${PACKAGE}/ in snap build step (#665)

github: s/lxd/${PACKAGE}/ in snap build step (#665) #1210

Workflow file for this run

name: Builds
on:
push:
branches:
- latest-edge
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
snap:
name: Trigger snap build
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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: `ver` contains an array with the 2 versions
ver=($(lxd-snapcraft -package "${PACKAGE}" -get-version -file ~/"${PACKAGE}-pkg-snap-lp/snapcraft.yaml"))
rsync -a --exclude .git --delete . ~/"${PACKAGE}-pkg-snap-lp"/
cd ~/"${PACKAGE}-pkg-snap-lp"
lxd-snapcraft -package "${PACKAGE}" -set-version "${ver[0]}" -set-source-commit "${ver[1]}"
git add --all
git commit --all --quiet -s --allow-empty -m "Automatic upstream build (${BRANCH})" -m "Upstream commit: ${localRev}"
git show
git push --quiet