Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use release-please #86

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release Please
on:
push:
branches:
- develop

permissions:
actions: read # Read the metrics
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance / AWS

env:
MISE_PYTHON_COMPILE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
cli-release-created: ${{ steps.release.outputs['.--release_created'] }}
server-release-created: ${{ steps.release.outputs['gitops_server--release_created'] }}
helm-release-created: ${{ steps.release.outputs['charts/gitops--release_created'] }}
cli-version: ${{ steps.release.outputs['.--tag_name'] }}
server-version: ${{ steps.release.outputs['gitops_server--tag_name'] }}
helm-version: ${{ steps.release.outputs['charts/gitops--tag_name'] }}
sha: ${{ steps.release.outputs.sha }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with: {}
publish_helm_chart:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.server-version }} || ${{ needs.release-please.outputs.helm-version }}
steps:
- uses: actions/checkout@v3
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
app_version: "${{ needs.release-please.outputs.server-version }}"
chart_version: "${{ needs.release-please.outputs.helm-version }}"
publish_to_pypi:
mdesouky marked this conversation as resolved.
Show resolved Hide resolved
name: Publishes tag to pypi
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.cli-version }}
steps:
- uses: actions/checkout@v3

- uses: jdx/mise-action@v2
with:
install: true
cache: true
experimental: true

- run: |
mise run build
shell: bash

- name: Publish Pypi Package
uses: pypa/gh-action-pypi-publish@release/v1
publish_docker_image:
name: Build and Push Docker Image
uses: uptick/actions/.github/workflows/ci.yaml@main
needs: release-please
if: ${{ needs.release-please.outputs.server-version }}
secrets:
SECRET_ENV: "${{ secrets.CLUSTER_KEY }}"
#https://github.com/uptick/actions/blob/main/.github/workflows/ci.yaml
with:
aws-iam-role-arn: "arn:aws:iam::305686791668:role/default-github-actions-ci-role"
docker-enabled: true
docker-context: "."
docker-tag: "${{ needs.release-please.outputs.server-version }}"
docker-tag-latest: true
docker-image-platforms: linux/amd64
docker-repository: "305686791668.dkr.ecr.ap-southeast-2.amazonaws.com/gitops"
command: echo $SECRET_ENV | base64 -d > cluster.key
5 changes: 5 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"gitops": "0.12.1",
"gitops_server": "0.12.1",
"charts/gitops": "0.12.1"
}
Empty file added CHANGELOG.md
Empty file.
Empty file added charts/gitops/CHANGELOG.md
Empty file.
Empty file added gitops_server/CHANGELOG.md
Empty file.
30 changes: 30 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"packages": {
".": {
"package-name": "cli",
"release-type": "python",
"changelog-path": "CHANGELOG.md",
"exclude-paths": [
"tests/",
"charts/gitops",
"gitops_server/"
]
},
"gitops_server": {
"package-name": "server",
"release-type": "python",
"changelog-path": "gitops_server/CHANGELOG.md",
"extra-files": [
{
"type": "helm",
"path": "charts/gitops/chart.yaml"
}
]
},
"charts/gitops": {
"package-name": "helm",
"release-type": "helm",
"changelog-path": "charts/gitops/CHANGELOG.md"
}
}
}
Loading