From 006dbc572ac68eadd91ff8d734bedefab2257da7 Mon Sep 17 00:00:00 2001 From: henrrypg Date: Wed, 5 Jun 2024 16:30:02 -0500 Subject: [PATCH] ci: change release workflow --- .github/workflows/release.yml | 80 +++++++++-------------------------- pyproject.toml | 29 +++++++++++++ 2 files changed, 49 insertions(+), 60 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41edb7cb..56d40c01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,67 +1,27 @@ name: Release + on: [workflow_dispatch] jobs: - bumpversion: - runs-on: ubuntu-latest - outputs: - version: ${{ steps.tag_version.outputs.new_version }} - previous_tag: ${{ steps.tag_version.outputs.previous_tag }} - bump_commit_sha: ${{ steps.bumpversion.outputs.commit_hash }} - steps: - - uses: actions/checkout@v3 - - name: Get next version - id: tag_version - uses: mathieudutour/github-tag-action@v6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - default_bump: false - default_prerelease_bump: false - dry_run: true - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - name: Create bumpversion - if: steps.tag_version.outputs.new_version - run: | - pip install bump2version - bump2version --new-version ${{ steps.tag_version.outputs.new_version }} setup.cfg - - name: Update Changelog - if: steps.tag_version.outputs.new_version - uses: stefanzweifel/changelog-updater-action@v1.6.2 - with: - latest-version: ${{ steps.tag_version.outputs.new_tag }} - release-notes: ${{ steps.tag_version.outputs.changelog }} - - name: Commit bumpversion - id: bumpversion - if: steps.tag_version.outputs.new_version - uses: stefanzweifel/git-auto-commit-action@v4.14.1 - with: - branch: ${{ github.ref }} - commit_message: "chore(release): preparing ${{ steps.tag_version.outputs.new_version }}" - file_pattern: CHANGELOG.md setup.cfg drydock/* release: - needs: bumpversion - if: needs.bumpversion.outputs.version runs-on: ubuntu-latest - outputs: - tag: ${{ steps.tag_version.outputs.new_tag }} - changelog: ${{ steps.tag_version.outputs.changelog }} + concurrency: release + permissions: + id-token: write + contents: write + steps: - - uses: actions/checkout@v3 - - name: Create tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - commit_sha: ${{ needs.bumpversion.outputs.bump_commit_sha }} - default_bump: false - default_prerelease_bump: false - - name: Create a GitHub release - if: steps.tag_version.outputs.new_tag - uses: ncipollo/release-action@v1 - with: - tag: ${{ steps.tag_version.outputs.new_tag }} - name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Python Semantic Release + uses: python-semantic-release/python-semantic-release@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + git_committer_name: 'Automatic Release Bot' + git_committer_email: 'support@edunext.co' + commit: true + tag: true + changelog: true + push: true diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..9133b91b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[tool.semantic_release] +assets = [] +build_command_env = [] +commit_message = "chore(release): preparing {version}" +commit_parser = "angular" +logging_use_named_masks = false +major_on_zero = true +allow_zero_version = true +no_git_verify = false +tag_format = "v{version}" + +[tool.semantic_release.branches.palm] +match = "palm" +prerelease = false + +[tool.semantic_release.changelog] +changelog_file = "CHANGELOG.md" + +[tool.semantic_release.changelog.environment] +keep_trailing_newline = true + +[tool.semantic_release.commit_author] +env = "GIT_COMMIT_AUTHOR" +default = "semantic-release " + +[tool.semantic_release.commit_parser_options] +allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"] +minor_tags = ["feat"] +patch_tags = ["fix", "perf"]