Skip to content

Commit

Permalink
Add automatic changelog generation in release workflow (#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerugbo committed Sep 10, 2024
1 parent 2ec1e31 commit 66f75dc
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ on:
required: true
type: boolean
default: false
createPullRequest:
description: 'Create pull request back into main'
required: true
type: boolean
default: false
uploadJWT:
description: 'Temporary JWT to publish packages to up-ap.nginx.com'
required: true
Expand Down Expand Up @@ -125,12 +120,27 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y gpgv1 monkeysphere
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
- name: Tag release
go install github.com/goreleaser/nfpm/v2/cmd/[email protected]
- name: Generate Changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone https://github.com/nginx/agent-changelog.git
cd ./agent-changelog/source
pip install -r requirements.txt
python agent.py
- name: Push Changelog
run: |
mv agent-changelog/source/changelog.md ./site/content/
git config --global user.name 'github-actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add ./site/content/changelog.md
git commit -m "Add generated changelog"
git push origin HEAD:${{ github.ref_name }}
- name: Tag release
run: |
git tag -a "v${{env.VERSION}}" -m "CI Autogenerated"
git tag -a "sdk/v${{env.VERSION}}" -m "CI Autogenerated"
- name: Push Tags
Expand Down Expand Up @@ -175,8 +185,6 @@ jobs:
az logout
if: always()
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# clobber overwrites existing assets of the same name
run: |
gh release upload --clobber v${{env.VERSION}} \
Expand All @@ -202,7 +210,7 @@ jobs:
}))
console.log(`Release published: ${release.data.html_url}`)
- name: Create Pull Request
if: ${{ inputs.publishPackages == true && inputs.createPullRequest == true }}
if: ${{ inputs.publishPackages == true }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand Down

0 comments on commit 66f75dc

Please sign in to comment.