Skip to content

Commit

Permalink
combine version bump and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed May 20, 2022
1 parent 2154b88 commit 0c34243
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/_release-prep.yml
Expand Up @@ -142,7 +142,7 @@ jobs:
if: needs.audit-changelog.outputs.exists == 'true'

steps:
- name: Changelog Exists, Skip Release Prep
- name: Changelog Exists, Skip Generating New Changelog
run: echo A changelog file already exists at ${{ needs.audit-changelog.outputs.exists }}, skipping generating changelog

skip-version-bump:
Expand Down Expand Up @@ -180,10 +180,9 @@ jobs:
- name: Job Output
run: echo BRANCH_NAME ${{ steps.variables.outputs.BRANCH_NAME }}

generate-changelog:
generate-changelog-bump-version:
runs-on: ubuntu-latest
needs: [audit-changelog, create-new-branch]
if: needs.audit-changelog.outputs.exists == 'false'
needs: [audit-changelog, check-current-version, create-new-branch]

steps:
- name: Check out the repository
Expand All @@ -192,23 +191,25 @@ jobs:
ref: ${{needs.create-new-branch.outputs.BRANCH_NAME}}

- name: Install changie
if: needs.audit-changelog.outputs.exists == 'false'
run: |
brew tap miniscruff/changie https://github.com/miniscruff/changie
brew install changie
- name: Generate Pre Release Changelog
if: needs.audit-changelog.outputs.is_prerelease == 1
if: needs.audit-changelog.outputs.is_prerelease == 1 && needs.audit-changelog.outputs.exists == 'false'
run: |
changie batch ${{ needs.audit-changelog.outputs.base_version }} --move-dir '${{ needs.audit-changelog.outputs.base_version }}' --prerelease ${{ needs.audit-changelog.outputs.prerelease }}
changie merge
- name: Generate Final Release Changelog
if: needs.audit-changelog.outputs.is_prerelease == 0
if: needs.audit-changelog.outputs.is_prerelease == 0 && needs.audit-changelog.outputs.exists == 'false'
run: |
changie batch ${{ needs.audit-changelog.outputs.base_version }} --include '${{ needs.audit-changelog.outputs.base_version }}' --remove-prereleases
changie merge
- name: Check Changelog Created Successfully
if: needs.audit-changelog.outputs.exists == 'false'
run: |
if [[ -f ${{ needs.audit-changelog.outputs.changelog_path }} ]]
then
Expand All @@ -218,37 +219,20 @@ jobs:
exit 1
fi
- name: Commit & Push changes
run: |
git config user.name 'Github Build Bot'
git config user.email 'buildbot@fishtownanalytics.com'
git pull
git add .
git commit -m "Generated changelog for version ${{ inputs.version_number }}"
git push
bump-version:
runs-on: ubuntu-latest
needs: [check-current-version, create-new-branch]
if: needs.check-current-version.outputs.up_to_date == 'false'

steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
ref: ${{ needs.create-new-branch.outputs.BRANCH_NAME }}

- uses: actions/setup-python@v2
if: needs.check-current-version.outputs.up_to_date == 'false'
with:
python-version: "3.8"

- name: Install python dependencies
if: needs.check-current-version.outputs.up_to_date == 'false'
run: |
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
- name: Bump version
if: needs.check-current-version.outputs.up_to_date == 'false'
# note: bumpversion is no longer supported, it actually points to bump2version now
run: |
source env/bin/activate
Expand All @@ -262,7 +246,7 @@ jobs:
git config user.email 'buildbot@fishtownanalytics.com'
git pull
git add .
git commit -m "Bumping version to ${{ inputs.version_number }}"
git commit -m "Bumping version to ${{ inputs.version_number }} and generate changelog"
git push
run-tests:
Expand Down

0 comments on commit 0c34243

Please sign in to comment.