Skip to content

Commit

Permalink
fix(ci): move to a independent release workflow (#13)
Browse files Browse the repository at this point in the history
Use release please for helm and publish chart on release.

Signed-off-by: Anthony Rabbito <[email protected]>
  • Loading branch information
anthr76 authored Jun 28, 2024
1 parent 79d24bd commit 797e742
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .github/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"chart/tailscale-derp": "0.2.0"
}
8 changes: 8 additions & 0 deletions .github/release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
"chart/tailscale-derp": {
"release-type": "helm"
}
}
}
35 changes: 35 additions & 0 deletions .github/workflows/charts-publish-oci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Charts: Publish to GHCR OCI"

on:
release:
types: [published]
workflow_dispatch: {}

jobs:
publish-charts:
name: Publish chart
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install Helm
uses: azure/setup-helm@v4

- name: Package & Push Helm Charts
shell: bash
run: |
helm package chart/tailscale-derp --dependency-update
pkg=$(ls tailscale-derp-*.tgz)
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}/chart
49 changes: 0 additions & 49 deletions .github/workflows/charts-release-oci.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Release"

on:
workflow_dispatch: {}
push:
branches: [main]

jobs:
release:
name: Release
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-22.04
steps:
- name: release
uses: googleapis/release-please-action@v4
id: release
with:
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# General files for the project
pkg/*
*.pyc
bin/*
.project
/.bin
/_test/secrets/*.json

# OSX leaves these everywhere on SMB shares
._*

# OSX trash
.DS_Store

# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA
.idea/
*.iml

# Vscode files
.vscode

# Emacs save files
*~
\#*\#
.\#*

# Vim-related files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist

# Chart dependencies
**/chart/*.tgz

.history
2 changes: 0 additions & 2 deletions chart/tailscale-derp/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Default values for tailscale-derp.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

derpServerHostname: 'derp.foo.bar'

Expand Down

0 comments on commit 797e742

Please sign in to comment.