Skip to content

feat(overlord): allow adding external managers #245

feat(overlord): allow adding external managers

feat(overlord): allow adding external managers #245

Workflow file for this run

name: Pebble snap
on:
pull_request:
branches: [master]
release:
types: [published]
env:
SNAP_NAME: pebble
jobs:
build:
runs-on: ubuntu-latest
outputs:
pebble-snap: ${{ steps.build-pebble-snap.outputs.snap }}
steps:
- name: Checkout Pebble repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build Pebble Snap
id: build-pebble-snap
uses: snapcore/action-build@v1
- name: Attach pebble snap to GH workflow execution
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build-pebble-snap.outputs.snap }}
path: ${{ steps.build-pebble-snap.outputs.snap }}
test:
runs-on: ubuntu-latest
needs: [build]
outputs:
pebble-version: ${{ steps.install-pebble.outputs.version }}
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.pebble-snap }}
- name: Install the Pebble snap
id: install-pebble
run: |
set -ex
# Install the Pebble snap from the artifact built in the previous job
sudo snap install --dangerous --classic ${{ needs.build.outputs.pebble-snap }}
# Make sure Pebble is installed
echo "version=$(pebble version --client)" >> "$GITHUB_OUTPUT"
- name: Run smoke test
run: pebble enter --create-dirs exec echo Hello | grep Hello
promote:
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
needs: [test]
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64, ppc64el, armhf, s390x]
env:
TRACK: latest
DEFAULT_RISK: edge
TO_RISK: candidate
steps:
- name: Install Snapcraft
run: sudo snap install snapcraft --classic
- name: Wait for ${{ needs.test.outputs.pebble-version }} to be released
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
while ! `snapcraft status ${{ env.SNAP_NAME }} --track ${{ env.TRACK }} --arch ${{ matrix.arch }} \
| grep "${{ env.DEFAULT_RISK }}" \
| awk -F' ' '{print $2}' \
| grep -Fxq "${{ needs.test.outputs.pebble-version }}"`; do
echo "[${{ matrix.arch }}] Waiting for ${{ needs.test.outputs.pebble-version }} \
to be released to ${{ env.TRACK }}/${{ env.DEFAULT_RISK }}..."
sleep 10
done
# It would be easier to use `snapcraft promote`, but there's an error when trying
# to avoid the prompt with the "--yes" option:
# > 'latest/edge' is not a valid set value for --from-channel when using --yes.
- name: Promote ${{ needs.test.outputs.pebble-version }} (${{ matrix.arch }}) to ${{ env.TO_RISK }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
revision="$(snapcraft status ${{ env.SNAP_NAME }} \
--track ${{ env.TRACK }} --arch ${{ matrix.arch }} \
| grep "${{ env.DEFAULT_RISK }}" | awk -F' ' '{print $3}')"
snapcraft release ${{ env.SNAP_NAME }} \
$revision \
${{ env.TRACK }}/${{ env.TO_RISK }}