Skip to content

Commit

Permalink
chore: On release, push to ghcr instead of pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
ducdetronquito committed Nov 13, 2024
1 parent e79648f commit 7c03b0e
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 70 deletions.
82 changes: 12 additions & 70 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,19 @@ name: "Release"

on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- main

jobs:
releasetag:
uses: ZeroGachis/.github/.github/workflows/releasetag.yml@v4

build:
needs: releasetag
uses: ZeroGachis/.github/.github/workflows/build-image.yml@v4
with:
image_name: nurse
dockerfile_context: .
vault_enabled: false
tailscale_enabled: false
regitry_url: ghcr.io
secrets: inherit

static-metrics:
needs:
[
build,
]
uses: ZeroGachis/.github/.github/workflows/run-docker.yml@v4
with:
image_url: ${{ needs.build.outputs.image-url }}
tailscale_enabled: false
vault_enabled: false
workdir: /app
run_command: |
ruff check --diff ./
ruff format --check --diff ./
secrets: inherit

unit-tests:
needs:
[
build,
]
uses: ZeroGachis/.github/.github/workflows/run-pytest.yml@v4
github-release:
uses: ZeroGachis/.github/.github/workflows/gh-release-please.yml@v4
with:
image_url: ${{ needs.build.outputs.image-url }}
workdir: /app
directory_to_test: tests/
env_django_settings_module: todo-make-this-optional
secrets: inherit

push:
needs:
[
build,
unit-tests,
static-metrics,
]
uses: ZeroGachis/.github/.github/workflows/push-pypi.yml@v1
with:
image_url: ${{ needs.build.outputs.image-url }}
workdir: /app
secrets: inherit

detroy:
if: always()
needs:
[
releasetag,
build,
unit-tests,
static-metrics,
]
uses: ZeroGachis/.github/.github/workflows/delete-docker-image.yml@v1
major_and_minor_tags: false
publish:
needs: github-release
if: ${{ needs.github-release.outputs.release_created == 'true' }}
uses: ZeroGachis/.github/.github/workflows/python-publish.yml@v4
with:
image_name: nurse
image_version: ${{ needs.build.outputs.image-version }}
secrets: inherit
python_version: "3.12"
environment_name: main
Empty file added CHANGELOG.md
Empty file.
60 changes: 60 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "python",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"include-v-in-tag": false,
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "feature"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "chore",
"section": "Miscellaneous Chores"
},
{
"type": "refactor",
"section": "Code Refactoring"
},
{
"type": "test",
"section": "Tests"
},
{
"type": "build",
"section": "Build System"
},
{
"type": "ci",
"section": "Continuous Integration"
}
],
"draft": false,
"prerelease": false
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

0 comments on commit 7c03b0e

Please sign in to comment.