Skip to content

Commit 94005e8

Browse files
committed
add workflow and documentation for OCI release
1 parent 3143ab1 commit 94005e8

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

.github/workflows/release-chart.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Publish chart as OCI image to GitHub registry. Version is automatically gathered from the tag name.
2+
# For this workflow to work, GITHUB_TOKEN needs to be configured with write permissions.
3+
# Additionally, the repository must be granted access in the package settings.
4+
5+
name: Publish chart
6+
7+
on:
8+
release:
9+
types: [ released ]
10+
11+
jobs:
12+
release:
13+
name: Publish chart to OCI registry
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Helm login
18+
run: |
19+
echo "${{ secrets.GITHUB_TOKEN }}" | \
20+
helm registry login ghcr.io \
21+
--username "$GITHUB_REPOSITORY_OWNER" \
22+
--password-stdin
23+
- name: Helm package
24+
run: |
25+
helm package . -u --version "${GITHUB_REF_NAME#v}"
26+
- name: Helm push
27+
run: |
28+
helm push \
29+
"mastodon-${GITHUB_REF_NAME#v}.tgz" \
30+
"oci://ghcr.io/$GITHUB_REPOSITORY_OWNER/charts"

Chart.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ description: Mastodon is a free, open-source social network server based on Acti
1212
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
1313
type: application
1414

15-
# This is the chart version. This version number should be incremented each time you make changes
16-
# to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 4.1.2
15+
# Chart version is set to 0.0.0 in the source tree. The release pipeline replaces this with the version
16+
# being released in build time.
17+
# Please refer to git tags and/or GitHub releases to check out the latest version.
18+
version: 0.0.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ Kubernetes cluster. The basic usage is:
99

1010
This chart is tested with k8s 1.21+ and helm 3.6.0+.
1111

12+
# Installation
13+
14+
This chart is [released as an OCI image](https://helm.sh/docs/topics/registries/) to `ghcr.io/mastodon/charts/mastodon`. You can install it without the need to add any repository to your helm installation using:
15+
16+
```shell
17+
helm install mastodon oci://ghcr.io/mastodon/charts/mastodon --values your-values-file.yaml
18+
```
19+
20+
You can also add it as a dependency to another chart in your Chart.yaml:
21+
22+
```yaml
23+
dependencies:
24+
- name: mastodon
25+
version: 4.0.0
26+
repository: oci://ghcr.io/mastodon/charts
27+
```
28+
1229
# Configuration
1330
1431
The variables that _must_ be configured are:

0 commit comments

Comments
 (0)