Skip to content

Add Openstack overlay #50

Add Openstack overlay

Add Openstack overlay #50

Workflow file for this run

# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
name: Build Bundle
on:
push:
branches:
- main
- release-*
pull_request:
jobs:
bundle-track:
name: Find track from branch
runs-on: ubuntu-latest
outputs:
track: ${{steps.find-track.outputs.TRACK}}
steps:
- name: Find Track
id: find-track
env:
BRANCH: ${{ github.event.ref || github.event.pull_request.base.ref }}
run: |
BRANCH=${BRANCH#refs/heads/} # strip off refs/heads/ if it exists
if [[ "${BRANCH}" == "main" ]]; then
echo "TRACK=latest" >> "$GITHUB_OUTPUT"
elif [[ "${BRANCH}" =~ ^release-[0-9]+\.[0-9]+$ ]]; then
echo "TRACK=${BRANCH:8}" >> "$GITHUB_OUTPUT"
else
echo "::error Failed to determine track from branch ${BRANCH}"
exit 1
fi
build-bundles:
name: Build and push bundles
runs-on: ubuntu-latest
needs: bundle-track
strategy:
matrix:
risk: [edge, beta, candidate, stable]
env:
track: ${{ needs.bundle-track.outputs.track }}
channel: ${{ needs.bundle-track.outputs.track }}/${{matrix.risk}}
steps:
- uses: actions/checkout@v4
- name: Pack Bundle
id: packed
continue-on-error: true
run: |
sudo snap install charmcraft --classic --channel latest/stable
./pack.sh main ${{env.track}} ${{matrix.risk}}
echo "BUNDLE_FILE=$(find ${PWD}/main -name '*.zip')" >> $GITHUB_ENV
- name: Upload bundle to ${{env.channel}}
if: github.event_name == 'push' && steps.packed.outcome == 'success'
uses: canonical/charming-actions/upload-bundle@2.6.3
with:
bundle-path: ./main
channel: ${{env.channel}}
credentials: "${{ secrets.CHARMCRAFT_AUTH }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Push Event Report
if: github.event_name != 'push' && steps.packed.outcome == 'success'
run: |
echo "Don't upload ${{ env.BUNDLE_FILE }} to ${{ env.channel }} on push event"