-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (69 loc) · 2.41 KB
/
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
name: Release to latest/edge
on:
workflow_call:
inputs:
source_branch:
description: Github branch from this repo to publish. If blank, will use the default branch
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: Github branch from this repo to publish. If blank, will use the default branch
required: false
default: ''
type: string
push:
branches:
- main
- track/**
jobs:
charm-tests:
uses: ./.github/workflows/charm-integration.yaml
release-to-charmhub:
name: Release to CharmHub
needs:
- charm-tests
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Release any bumped charm libs
uses: canonical/charming-actions/release-libraries@2.2.2
with:
charm-path: "./charms/openfga-k8s"
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Build local images
run: make build-image
- name: Select charmhub channel
uses: canonical/charming-actions/channel@631c2d944da2bd12430f1f3a954c8fffcf2385cd # 2.4.0
id: select-channel
if: ${{ inputs.destination_channel == '' }}
# Combine inputs from different sources to a single canonical value so later steps don't
# need logic for picking the right one
- 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: Upload charm to charmhub
uses: kian99/charming-actions/upload-charm@add-local-image-option
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
channel: ${{ steps.parse-inputs.outputs.destination_channel }}
charm-path: "./charms/openfga-k8s"
local-image: "true"