From 7c03b0e4682027cf7d9fd235c0f61ed54f3b243f Mon Sep 17 00:00:00 2001 From: ducdetronquito Date: Wed, 13 Nov 2024 10:58:18 +0100 Subject: [PATCH] chore: On release, push to ghcr instead of pypi --- .github/workflows/release.yml | 82 +++++------------------------------ CHANGELOG.md | 0 release-please-config.json | 60 +++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 release-please-config.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d9b5ec..347d328 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..c7ee592 --- /dev/null +++ b/release-please-config.json @@ -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" +} \ No newline at end of file