Skip to content

Commit

Permalink
ci: Replace releaser and circleci with release please
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Feb 21, 2024
1 parent 97ce77d commit 28656f3
Show file tree
Hide file tree
Showing 18 changed files with 207 additions and 102 deletions.
49 changes: 0 additions & 49 deletions .circleci/config.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Quality control
description: 'Run quality control checks'

runs:
using: composite
steps:
- name: Run tests against chart
shell: bash
run: make test

- name: Ensure golden files are up-to-date
shell: bash
run: |
make update-golden-files
[[ -z $(git status --porcelain) ]]
51 changes: 51 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish Chart
description: 'Publish to gh-pages-backed chart repository'
inputs:
dry_run:
description: 'Is this a dry run. If so no package will be published.'
required: true
token:
description: 'The GitHub token used to upload artifacts to the published release'
required: true

runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
path: helm-repo

- name: Determine chart version
shell: bash
id: version
run: |
version=$(helm show chart . | awk '/version/ { print $2 }')
echo "CHART_VERSION=$version" >> "$GITHUB_OUTPUT"
echo "ARTIFACT=ld-relay-$version.tgz" >> "$GITHUB_OUTPUT"
- name: Package the helm chart
shell: bash
run: make package

- name: Generate updated index.yaml
shell: bash
run: helm repo index . --url https://launchdarkly.github.io/ld-relay-helm --merge helm-repo/index.yaml

- name: Move files into publishable directory
shell: bash
run: mv ${{ steps.version.outputs.ARTIFACT }} index.yaml helm-repo

- name: Publish to GitHub pages
if: ${{ inputs.dry_run == 'false' }}
uses: launchdarkly/gh-actions/actions/[email protected]
with:
docs_path: helm-repo
github_token: ${{ inputs.token }}

- name: Attach published chart to release
if: ${{ inputs.dry_run == 'false' }}
shell: bash
run: gh release upload ${{ steps.version.outputs.CHART_VERSION }} helm-repo/${{ steps.version.outputs.ARTIFACT }} --clobber
env:
GH_TOKEN: ${{ inputs.token }}
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Quality control

on:
push:
branches: [ main ]
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'

jobs:
ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: azure/[email protected]

- name: Run quality control checks
uses: ./.github/actions/ci
12 changes: 12 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Lint PR title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
lint-pr-title:
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
28 changes: 28 additions & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Package
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Is this a dry run? If so no package will be published.'
type: boolean
required: true

jobs:
build-publish:
runs-on: ubuntu-latest
# Needed to get tokens during publishing.
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4

- uses: azure/[email protected]

- name: Run quality control checks
uses: ./.github/actions/ci

- uses: ./.github/actions/publish
with:
dry_run: ${{ inputs.dry_run }}
token: ${{ secrets.GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run Release Please

on:
push:
branches: [ main ]

jobs:
release-package:
runs-on: ubuntu-latest
permissions:
id-token: write # Needed if using OIDC to get release secrets.
contents: write # Contents and pull-requests are for release-please to make releases.
pull-requests: write
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main

- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}
with:
fetch-depth: 0 # If you only need the current version keep this.

- uses: azure/[email protected]
if: ${{ steps.release.outputs.releases_created }}

- name: Run quality control checks
if: ${{ steps.release.outputs.releases_created }}
uses: ./.github/actions/ci

- uses: ./.github/actions/publish
if: ${{ steps.release.outputs.releases_created }}
with:
dry_run: false
token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
# Happen once per day at 1:30 AM
- cron: '30 1 * * *'

jobs:
sdk-close-stale:
uses: launchdarkly/gh-actions/.github/workflows/sdk-stale.yml@main
25 changes: 0 additions & 25 deletions .ldrelease/build.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .ldrelease/config.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .ldrelease/prepare.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .ldrelease/update-version.sh

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "3.3.0"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Change log
All notable changes to the LaunchDarkly Relay Proxy Helm Chart will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org).


## [3.3.0](https://github.com/keelerm84/playground/compare/3.2.0...3.3.0) (2024-02-21)


### Features

* Remove releaser config ([823a5ef](https://github.com/keelerm84/playground/commit/823a5efb51e77e787e0d415424896c7819606d0b))


### Bug Fixes

* Fix manual publish ([3d193e3](https://github.com/keelerm84/playground/commit/3d193e3810a00e896a7025adf3e530dc65f63e88))

## [3.2.0] - 2024-02-21
### Added:
- Add support for container lifecycle hooks. (Thanks, [Helinanu](https://github.com/launchdarkly/ld-relay-helm/pull/57)!)
Expand Down
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.2.0
version: 3.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ unittest: #! Run the unit tests
lint: #! Run helm lint against this chart
@helm lint

.PHONY: package
package: #! Build the helm package (e.g. ld-relay-x.y.z.tgz)
@helm package .

.PHONY: update-golden-files
update-golden-files: #! Update unit test golden files (WARNING: Will change your local fs)
@go test ./test -update-golden=true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LaunchDarkly Relay Proxy Helm Chart

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/launchdarkly/ld-relay-helm/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/launchdarkly/ld-relay-helm/tree/main)
[![Quality control](https://github.com/launchdarkly/ld-relay-helm/actions/workflows/ci.yml/badge.svg)](https://github.com/launchdarkly/ld-relay-helm/actions/workflows/ci.yml)

A Helm chart to ease deployment of the [LaunchDarkly Relay Proxy](https://github.com/launchdarkly/ld-relay) to Kubernetes (k8s).

Expand Down
10 changes: 10 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": {
".": {
"release-type": "helm",
"versioning": "default",
"include-v-in-tag": false,
"include-component-in-tag": false
}
}
}

0 comments on commit 28656f3

Please sign in to comment.