Skip to content

Commit 5805280

Browse files
committed
add workflow and documentation for OCI release
1 parent 69df639 commit 5805280

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed
Lines changed: 30 additions & 0 deletions
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

Lines changed: 4 additions & 4 deletions
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
16-
# you make changes to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 5.1.1
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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@ We still encourage suggestions and PRs to help make this chart better, and this
1717

1818
Please see the pinned [GitHub issue](https://github.com/mastodon/chart/issues/129) for more info & discussion.
1919

20+
# Installation
21+
22+
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:
23+
24+
```shell
25+
helm install mastodon oci://ghcr.io/mastodon/charts/mastodon --values your-values-file.yaml
26+
```
27+
28+
You can also add it as a dependency to another chart in your Chart.yaml:
29+
30+
```yaml
31+
dependencies:
32+
- name: mastodon
33+
version: 4.0.0
34+
repository: oci://ghcr.io/mastodon/charts
35+
```
36+
2037
# Configuration
2138
2239
The variables that _must_ be configured are:

0 commit comments

Comments
 (0)