Skip to content
Merged
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
18 changes: 7 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,19 @@ jobs:
echo new major ${{ steps.versions.outputs.NEW_MAJOR }}
echo new minor ${{ steps.versions.outputs.NEW_MINOR }}
echo new patch ${{ steps.versions.outputs.NEW_PATCH }}
- name: Extract branch name
shell: bash
run: echo "BRANCH=$(echo ${github.base_ref})" >> $GITHUB_OUTPUT
id: branch

- name: Debug branch name
run: |
echo current branch ${{ steps.branch.outputs.BRANCH }}
echo current branch ${{ github.base_ref }}
- name: Exit on bad tag
if: ${{ (inputs.version_bump == 'major' || (inputs.version_bump == '' && contains(github.event.pull_request.labels.*.name, 'release:major'))) && !contains(steps.branch.outputs.BRANCH, inputs.main_branch) }}
if: ${{ (inputs.version_bump == 'major' || (inputs.version_bump == '' && contains(github.event.pull_request.labels.*.name, 'release:major'))) && !contains(github.base_ref, inputs.main_branch) }}
run: |
echo Can't create a major release on branch ${{ steps.branch.outputs.BRANCH }}
echo Can't create a major release on branch ${{ github.base_ref }}
exit 1
- name: Exit on bad branch
if: ${{ !contains(fromJson(inputs.dist_branches), steps.branch.outputs.BRANCH) }}
if: ${{ !contains(fromJson(inputs.dist_branches), github.base_ref) }}
run: |
echo Can't create a release on branch ${{ steps.branch.outputs.BRANCH }}
echo Can't create a release on branch ${{ github.base_ref }}
exit 1

- name: Prepare release tag env var
Expand Down Expand Up @@ -193,15 +189,15 @@ jobs:
if: ${{ !contains(env.RELEASE_VERSION, 'undefined') && (inputs.version_ini_path != '' || inputs.toml_conf_path != '' || inputs.package_json_version == 'true') }}
with:
commit_message: "chore: update version"
branch: ${{ steps.branch.outputs.BRANCH }}
branch: ${{ github.base_ref }}

- name: Create release and tag
if: ${{ !contains(env.RELEASE_VERSION, 'undefined') }}
uses: ncipollo/release-action@v1
with:
name: 'Release ${{ env.RELEASE_VERSION }}'
tag: 'v${{ env.RELEASE_VERSION }}'
commit: ${{ steps.branch.outputs.BRANCH }}
commit: ${{ github.base_ref }}
generateReleaseNotes: true

outputs:
Expand Down
Loading