Skip to content

Release 2.18.0

Release 2.18.0 #4676

Workflow file for this run

name: Snap
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-pr${{ github.event.number }}
cancel-in-progress: true
jobs:
arches:
runs-on: ubuntu-latest
outputs:
arches: ${{ steps.get-arches.outputs.arches }}
steps:
- id: get-arches
name: Determine which architectures to build for
run: |
ARCHES=( amd64 )
if ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}; then
ARCHES+=( armhf arm64 )
fi
jq --compact-output --null-input '$ARGS.positional' --args -- "${ARCHES[@]}" | awk '{ print "arches=" $0 }' >> $GITHUB_OUTPUT
mir-libs:
needs: [arches]
runs-on: ubuntu-latest
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
architecture: ${{ fromJSON(needs.arches.outputs.arches) }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for version determination
- name: Tweak the snapcraft.yaml
run: |
git config --global --add safe.directory $(pwd)
sed -i 's@version: testing@version: '$(git describe)'@' snap/snapcraft.yaml
- name: Build and publish the snap
uses: canonical/actions/build-snap@release
with:
architecture: ${{ matrix.architecture }}
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
launchpad-credentials: ${{ secrets.LAUNCHPAD_CREDENTIALS }}
launchpad-accept-public-upload: true
publish: ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}
publish-channel: 24/edge/pr${{ github.event.number }}
snap:
# Only run if we have access to secrets.
if: ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}
needs: [arches, mir-libs]
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
snap:
- canonical/mir-test-tools
- canonical/confined-shell-wip
- canonical/ubuntu-frame
- Miriway/Miriway
architecture: ${{ fromJSON(needs.arches.outputs.arches) }}
include:
- snap: canonical/mir-test-tools
track: 24
- snap: canonical/confined-shell-wip
track: latest
- snap: canonical/ubuntu-frame
track: 24
- snap: Miriway/Miriway
track: latest
review-opts: --allow-classic
steps:
- name: Check out code
uses: actions/checkout@v4
with:
repository: ${{ matrix.snap }}
ref: mir-libs-build
fetch-depth: 0 # needed for version determination
- name: Tweak the stage snap
run: |
sed -i 's@- mir-libs.*$@\0/pr${{ github.event.number }}@' snap/snapcraft.yaml
- name: Build and publish the snap
uses: canonical/actions/build-snap@release
with:
architecture: ${{ matrix.architecture }}
review-opts: ${{ matrix.review-opts }}
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
launchpad-credentials: ${{ secrets.LAUNCHPAD_CREDENTIALS }}
launchpad-accept-public-upload: true
publish: true
publish-channel: ${{ matrix.track }}/edge/mir-pr${{ github.event.number }}
snapcraft-channel: ${{ matrix.snapcraft-channel || 'stable' }}