-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub workflow for releases (#58)
Adds a new GitHub workflow for releases that will: - Upload the CRDs and default CR manifest - Build and push the docker image Closes https://linear.app/prefect/issue/PLA-220/design-release-process Closes #18
- Loading branch information
1 parent
b92b4c2
commit afc1c17
Showing
7 changed files
with
170 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# .github/release.yml | ||
|
||
changelog: | ||
exclude: | ||
labels: | ||
- maintenance | ||
categories: | ||
- title: Breaking Changes | ||
labels: | ||
- breaking | ||
- title: Dependency Updates | ||
labels: | ||
- dependencies | ||
- title: Documentation | ||
labels: | ||
- docs | ||
- title: Enhancements | ||
labels: | ||
- enhancement | ||
- title: Exciting New Features 🎉 | ||
labels: | ||
- feature | ||
- title: Fixes | ||
labels: | ||
- fix | ||
- title: Uncategorized | ||
labels: | ||
- "*" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# Prefect Operator release workflow. | ||
name: Release | ||
|
||
"on": | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install tool dependencies | ||
uses: jdx/mise-action@v2 | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Test | ||
run: make test | ||
|
||
build-and-upload-manifests: | ||
needs: unit-tests | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install tool dependencies | ||
uses: jdx/mise-action@v2 | ||
|
||
- name: Build manifests | ||
run: | | ||
(cd config/manager && kustomize edit set image controller=prefecthq/prefect-operator:${{ github.ref_name }}) | ||
kustomize build config/crd > prefect-crds.yaml | ||
kustomize build config/default > prefect.yaml | ||
- name: Upload release assets | ||
if: github.ref_type == 'tag' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh release upload ${{ github.ref_name }} prefect-crds.yaml prefect.yaml | ||
|
||
build-and-push-docker-image: | ||
needs: unit-tests | ||
runs-on: ubuntu-latest | ||
# The GitHub environments are created by Terraform and map to Docker Hub repositories: | ||
# - dev: https://hub.docker.com/r/prefecthq/prefect-operator-dev | ||
# - prod: https://hub.docker.com/r/prefecthq/prefect-operator | ||
# The environment will be 'prod' if the GitHub event is a release. Otherwise, it will be 'dev'. | ||
environment: ${{ github.event_name == 'release' && 'prod' || 'dev' }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
# These credentials are managed in Terraform. Depending on the 'environment' value above, | ||
# these will either be the credentials for 'dev' or 'prod'. | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker image metadata | ||
id: metadata | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: prefecthq/prefect-operator${{ github.event_name == 'pull_request' && '-dev' }} | ||
tags: | | ||
type=ref,event=pr | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
labels: | | ||
org.opencontainers.image.title=prefect-operator | ||
org.opencontainers.image.description=Prefect Operator image | ||
org.opencontainers.image.vendor=Prefect | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
[tools] | ||
actionlint = '1.7.1' | ||
ginkgo = '2.19.0' | ||
golang = '1.21' | ||
golangci-lint = '1.57.2' | ||
kube-controller-tools = '0.14.0' | ||
kubectl = '1.31' | ||
kustomize = '5.3.0' | ||
setup-envtest = '0.17.0' | ||
yamllint = '1.35.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
fail_fast: false | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
args: | ||
- --allow-multiple-documents | ||
- id: detect-private-key | ||
- id: no-commit-to-branch | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.28.0 | ||
hooks: | ||
- id: yamllint | ||
args: | ||
- --strict | ||
|
||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.7.1 | ||
hooks: | ||
- id: actionlint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
extends: default | ||
|
||
ignore: | | ||
config/ | ||
|
||
rules: | ||
comments: | ||
min-spaces-from-content: 1 | ||
comments-indentation: disable | ||
document-start: disable | ||
line-length: disable |