generated from snapcrafters/snap-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,44 +15,18 @@ env: | |
LAUNCHPAD_TOKEN: ${{ secrets.LAUNCHPAD_TOKEN }} | ||
|
||
jobs: | ||
build-strict: | ||
build: | ||
name: Build snap (strict) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
# snapcraft remote-build requires a full clone | ||
fetch-depth: 0 | ||
|
||
- name: Setup LXD | ||
uses: canonical/[email protected] | ||
with: | ||
channel: latest/stable | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo snap install --classic --channel edge snapcraft | ||
# Setup Launchpad credentials | ||
mkdir -p ~/.local/share/snapcraft | ||
echo -e "$LAUNCHPAD_TOKEN" >> ~/.local/share/snapcraft/launchpad-credentials | ||
mkdir -p ~/.local/share/snapcraft/provider/launchpad | ||
echo -e "$LAUNCHPAD_TOKEN" >> ~/.local/share/snapcraft/provider/launchpad/credentials | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Actions" | ||
- 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 | ||
|
||
- name: Upload and Publish arm64 Snap | ||
run: snapcraft upload --release edge grafana-agent_*_arm64.snap | ||
|
||
build-classic: | ||
name: Build snap (classic) | ||
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 | ||
|
@@ -79,14 +53,15 @@ jobs: | |
- name: yq - portable yaml processor | ||
uses: mikefarah/yq@v4 | ||
|
||
- name: Convert to Classic Snap | ||
- if: ${{ matrix.confinement == 'classic' }} | ||
name: Convert to Classic Snap | ||
run: ./make-classic.sh | ||
|
||
- name: Build Classic Snap (remote) | ||
- name: Build 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 amd64 Snap | ||
run: snapcraft upload --release ${{ matrix.channel }} grafana-agent_*_amd64.snap | ||
|
||
- name: Upload and Publish Classic arm64 Snap | ||
run: snapcraft upload --release 0.40-classic/edge grafana-agent_*_arm64.snap | ||
- name: Upload and Publish arm64 Snap | ||
run: snapcraft upload --release ${{ matrix.channel }} grafana-agent_*_arm64.snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,12 @@ env: | |
|
||
jobs: | ||
build: | ||
name: Build snap (strict) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
confinement: [ "strict", "classic" ] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
@@ -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 |