-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (56 loc) · 1.88 KB
/
publish.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
name: Publish Charm
on:
workflow_call:
inputs:
source_branch:
description: source branch to publish
default: ''
required: false
type: string
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
workflow_dispatch:
inputs:
destination_channel:
description: CharmHub channel to publish to
required: false
default: 'latest/edge'
type: string
source_branch:
description: source branch to publish
required: false
default: ''
type: string
jobs:
publish-charm:
name: Publish Charm
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
ref: ${{ inputs.source_branch }}
- name: Select CharmHub channel
uses: canonical/charming-actions/channel@46fe0c6d63324b5f74ce0e65d6ab47051953cc48 # 2.6.2
id: select-channel
if: ${{ inputs.destination_channel == '' }}
- name: Parse and combine inputs
id: parse-inputs
run: |
# destination_channel
destination_channel="${{ inputs.destination_channel || steps.select-channel.outputs.name }}"
echo "setting output of destination_channel=$destination_channel"
echo "::set-output name=destination_channel::$destination_channel"
- name: Setup lxd
uses: canonical/[email protected]
with:
channel: latest/stable
- name: Upload charm to CharmHub
uses: canonical/charming-actions/upload-charm@46fe0c6d63324b5f74ce0e65d6ab47051953cc48 # 2.6.2
with:
credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
github-token: ${{ secrets.GITHUB_TOKEN }}
channel: ${{ steps.parse-inputs.outputs.destination_channel }}
destructive-mode: false