-
Notifications
You must be signed in to change notification settings - Fork 22
80 lines (76 loc) · 2.4 KB
/
charm-release.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Release Charm
on:
workflow_call:
inputs:
charm-path:
description: "Path to the charm we want to publish. Defaults to the current working directory."
default: '.'
required: false
type: string
artifact:
description: "Name of artifact to download before building. Must contain the file artifact.tar.gz."
default: ''
required: false
type: string
provider:
description: "The provider to choose for either machine or k8s tests ('lxd' or 'microk8s')"
default: 'microk8s'
required: false
type: string
ip-range:
type: string
description: |
The IP range in the address pool for the load balancer to use.
It can be either a subnet(IP/mask) or a range (<IP1>-<IP2>)
required: false
default: ""
secrets:
CHARMHUB_TOKEN:
required: true
OBSERVABILITY_NOCTUA_TOKEN:
required: true
concurrency:
group: release
cancel-in-progress: true
jobs:
quality-checks:
name: Quality Checks
uses: ./.github/workflows/_charm-quality-checks.yaml@main
secrets: inherit
with:
charm-path: "${{ inputs.charm-path }}"
provider: "${{ inputs.provider }}"
ip-range: "${{ inputs.ip-range }}"
release-charm:
name: Release Charm and Libraries
needs:
- quality-checks
uses: ./.github/workflows/_charm-release.yaml@main
secrets: inherit
with:
artifact: "${{ inputs.artifact }}"
charm-path: "${{ inputs.charm-path }}"
release-libs:
name: Release any bumped charm library
needs:
- quality-checks
runs-on: ubuntu-latest
steps:
- name: Checkout the source
uses: actions/checkout@v3
with:
fetch-depth: 1
path: charm
- name: Release libraries
run: |
# Install Charmcraft
sudo snap install charmcraft --classic --channel latest/stable
cd $GITHUB_WORKSPACE/charm/${{ inputs.charm-path }}
# Get the libs folder name
libraries_folder=$(yq .name metadata.yaml | tr - _)
# For each library belonging to the charm, publish it
for lib in $(find lib/charms/$libraries_folder -type f | sed 's|lib/||' | sed 's/.py//' | sed 's|/|.|g'); do
charmcraft publish-lib $lib
done
env:
CHARMCRAFT_AUTH: "${{ secrets.CHARMHUB_TOKEN }}"