-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(actions): automate changelog creation process (#1082)
- Loading branch information
1 parent
42ea65c
commit 2b2566c
Showing
6 changed files
with
74 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,21 +44,17 @@ jobs: | |
run: echo "::set-output name=value::${{ steps.semantic.outputs.value }}.pre${{ steps.build_number.outputs.value }}" | ||
|
||
|
||
prerelease: | ||
name: Generates Prerelease | ||
prerelease-tag: | ||
name: Create Prerelease Tag | ||
runs-on: ubuntu-20.04 | ||
|
||
needs: | ||
- prepare | ||
|
||
steps: | ||
- name: Create Pre Release | ||
uses: softprops/action-gh-release@v1 | ||
- uses: simpleactions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
with: | ||
tag_name: ${{ needs.prepare.outputs.version }} | ||
name: ${{ needs.prepare.outputs.version }} | ||
body: ${{ github.event.head_commit.message }} | ||
target_commitish: ${{ github.sha }} | ||
prerelease: true | ||
tag: ${{ needs.prepare.outputs.version }} | ||
message: ${{ github.event.head_commit.message }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,9 @@ jobs: | |
outputs: | ||
build_number: ${{ steps.build_number.outputs.value }} | ||
new_release: ${{ steps.semantic.outputs.new_release_published }} | ||
release: ${{ steps.semantic.outputs.new_release_version }} | ||
release: v${{ steps.semantic.outputs.new_release_version }} | ||
release_notes: ${{ steps.semantic.outputs.new_release_notes }} | ||
version: ${{ steps.version.outputs.value }} | ||
version: v${{ steps.version.outputs.value }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -31,7 +31,6 @@ jobs: | |
with: | ||
branch: master | ||
dry_run: true | ||
semantic_version: 18.0.1 | ||
|
||
- name: Count number or releases for tag | ||
id: build_number | ||
|
@@ -41,32 +40,75 @@ jobs: | |
id: version | ||
run: echo "::set-output name=value::${{ steps.semantic.outputs.new_release_version }}.rc${{ steps.build_number.outputs.value }}" | ||
|
||
prerelease: | ||
docs-changelog: | ||
name: Update changelog on docs | ||
runs-on: ubuntu-20.04 | ||
|
||
needs: prepare | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Calculate changelog path | ||
id: path | ||
run: echo "$(echo "::set-output name=value::docsrc/source/pages/reference/changelog/${{ needs.prepare.outputs.release }}" | sed "s/\./_/g").rst" | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git config --local core.autocrlf false | ||
- name: Convert changelog from md to rst | ||
run: | | ||
sudo apt-get install -y pandoc | ||
echo "${{ needs.prepare.outputs.release_notes }}" \ | ||
| sed 's/# \[.*/# Changelog ${{ needs.prepare.outputs.release }}/g' \ | ||
| sed 's/## Bug Fixes/## 🐛 Bug fixes/g' \ | ||
| sed 's/## Features/## 🎉 Features/g' \ | ||
| sed 's/## BREAKING CHANGES/## 🚨 Breaking changes/g' \ | ||
| sed 's/## Documentation/## 📖 Documentation/g' \ | ||
| pandoc --from markdown --to rst --standalone > ${{ steps.path.outputs.value }} | ||
- name: Commit changelog | ||
run: | | ||
git add ${{ steps.path.outputs.value }} | ||
git commit -m "[skip ci] Update changelogs" -a || true | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
branch: ${{ github.ref }} | ||
github_token: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
prerelease-tag: | ||
if: needs.prepare.outputs.new_release == 'true' | ||
|
||
name: Generates Prerelease | ||
name: Create Prerelease Tag | ||
runs-on: ubuntu-20.04 | ||
|
||
needs: prepare | ||
needs: | ||
- prepare | ||
|
||
steps: | ||
- name: Create Pre Release | ||
uses: actions/create-release@v1 | ||
- uses: simpleactions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
with: | ||
tag_name: ${{ needs.prepare.outputs.version }} | ||
release_name: ${{ needs.prepare.outputs.version }} | ||
body: ${{ github.event.head_commit.message }} | ||
prerelease: true | ||
tag: ${{ needs.prepare.outputs.version }} | ||
message: ${{ github.event.head_commit.message }} | ||
|
||
draft-release: | ||
if: needs.prepare.outputs.new_release == 'true' | ||
|
||
name: Draft Release | ||
runs-on: ubuntu-20.04 | ||
|
||
needs: prepare | ||
needs: | ||
- prepare | ||
- docs-changelog | ||
|
||
steps: | ||
- name: Delete Previous drafts | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ on: | |
branches: | ||
- master | ||
|
||
|
||
jobs: | ||
commitlint: | ||
name: Lint commmit message | ||
|
@@ -16,7 +15,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: wagoid/commitlint-github-action@v3 | ||
|
||
lint: | ||
|
@@ -57,16 +56,23 @@ jobs: | |
- name: Install the package | ||
run: make install | ||
|
||
- name: Code formatting | ||
- name: Validate code formatting | ||
run: make lint | ||
|
||
- name: Commit code formatting changes | ||
id: commit | ||
run: | | ||
git add -u | ||
git commit -m "[skip ci] Code formatting" -a || true | ||
if [[ `git status --porcelain --untracked-files=no` ]]; then | ||
echo ::set-output name=CHANGES::true | ||
git add -u | ||
git commit -m "[skip ci] Code formatting" -a | ||
else | ||
echo ::set-output name=CHANGES::false | ||
fi | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
if: ${{ steps.commit.outputs.CHANGES == 'true' }} | ||
with: | ||
branch: ${{ github.head_ref }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_token: ${{ secrets.ACCESS_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters