-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (52 loc) · 1.47 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build ROCK
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
workflow_call:
outputs:
rock:
description: "The rock output of build process."
value: ${{ jobs.build.outputs.rock }}
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install yamllint
run: python3 -m pip install yamllint
- name: YAML Lint
run: |
yamllint -d "{extends: relaxed, rules: {line-length: {max: 250}}}" \
--no-warnings rockcraft.yaml
build:
runs-on: ubuntu-latest
timeout-minutes: 15
needs:
- lint
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup LXD
uses: canonical/setup-lxd@main
- name: Install dependencies
id: install
run: |
sudo snap install yq
sudo snap install rockcraft --classic --edge
- name: Build ROCK
id: build
run: |
VERSION=$(yq '.version' rockcraft.yaml)
rockcraft pack --verbose
echo "rock=charmed-karapace_${VERSION}_amd64.rock" >> $GITHUB_OUTPUT
- name: Upload locally built ROCK artifact
uses: actions/upload-artifact@v3
with:
name: charmed-karapace
path: ${{ steps.build.outputs.rock }}
outputs:
rock: ${{ steps.build.outputs.rock }}