Skip to content

Commit

Permalink
Split strict, classic CI (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
sed-i authored Nov 19, 2024
1 parent 01ef627 commit 2cb10b7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/release-snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ env:

jobs:
build:
name: Build snap (${{ matrix.confinement }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
confinement: [ "strict", "classic" ]
include:
- confinement: "strict"
channel: "latest/edge"
- confinement: "classic"
channel: "0.40-classic/edge"
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -43,23 +53,15 @@ jobs:
- name: yq - portable yaml processor
uses: mikefarah/yq@v4

- if: ${{ matrix.confinement == 'classic' }}
name: Convert to Classic Snap
run: ./make-classic.sh

- name: Build Snap (remote)
run: snapcraft remote-build --launchpad-accept-public-upload

- name: Upload and Publish amd64 Snap
run: snapcraft upload --release edge grafana-agent_*_amd64.snap
run: snapcraft upload --release ${{ matrix.channel }} grafana-agent_*_amd64.snap

- name: Upload and Publish arm64 Snap
run: snapcraft upload --release edge grafana-agent_*_arm64.snap

- name: Convert to Classic Snap
run: ./make-classic.sh

- name: Build Classic Snap (remote)
run: snapcraft remote-build --launchpad-accept-public-upload

- name: Upload and Publish Classic amd64 Snap
run: snapcraft upload --release 0.40-classic/edge grafana-agent_*_amd64.snap

- name: Upload and Publish Classic arm64 Snap
run: snapcraft upload --release 0.40-classic/edge grafana-agent_*_arm64.snap
run: snapcraft upload --release ${{ matrix.channel }} grafana-agent_*_arm64.snap
12 changes: 12 additions & 0 deletions .github/workflows/test-build-snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ env:

jobs:
build:
name: Build snap (${{ matrix.confinement }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
confinement: [ "strict", "classic" ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -35,5 +40,12 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
- name: yq - portable yaml processor
uses: mikefarah/yq@v4

- if: ${{ matrix.confinement == 'classic' }}
name: Convert to Classic Snap
run: ./make-classic.sh

- name: Build Snap (remote)
run: snapcraft remote-build --launchpad-accept-public-upload
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license: Apache-2.0
contact: [email protected]
issues: https://github.com/canonical/grafana-agent-snap/issues
source-code: https://github.com/canonical/grafana-agent-snap
website: https://grafana.com
website: https://grafana.com/oss/agent/
description: "Grafana Agent is a telemetry collector for sending metrics, \nlogs, and trace data to the opinionated Grafana observability stack.\n"
base: core22
grade: stable
Expand Down

0 comments on commit 2cb10b7

Please sign in to comment.