-
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): remove manual source code versioning (#1112)
- Loading branch information
1 parent
ab0d8f5
commit 7b19239
Showing
16 changed files
with
96 additions
and
78 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
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 |
---|---|---|
|
@@ -53,34 +53,46 @@ jobs: | |
|
||
- 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" | ||
run: echo "value=$(echo "${{ needs.prepare.outputs.release }}" | sed "s/\./_/g").md" >> $GITHUB_OUTPUT | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Azory" | ||
git config --local core.autocrlf false | ||
- name: Convert changelog from md to rst | ||
git config user.email "[email protected]" | ||
git config user.name "Azory YData Bot" | ||
git config core.autocrlf false | ||
- name: Write changelog to file | ||
uses: DamianReeves/write-file-action@master | ||
with: | ||
path: docsrc/source/pages/reference/changelog/${{ steps.path.outputs.value }} | ||
contents: ${{ needs.prepare.outputs.release_notes }} | ||
write-mode: overwrite | ||
|
||
- name: Add changelog to docs | ||
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 }} | ||
cd docsrc/source/pages/reference | ||
sed -i -e 's/# \[.*/# Changelog ${{ needs.prepare.outputs.release }}/g' \ | ||
-e 's/## Bug Fixes/## 🐛 Bug fixes/g' \ | ||
-e 's/## Features/## 🎉 Features/g' \ | ||
-e 's/## BREAKING CHANGES/## 🚨 Breaking changes/g' \ | ||
-e 's/## Documentation/## 📖 Documentation/g' \ | ||
changelog/${{ steps.path.outputs.value }} | ||
grep -q ".. include:: changelog/${{ steps.path.outputs.value }}" changelog.rst || sed -i "4 a\\ | ||
.. include:: changelog\/${{ steps.path.outputs.value }}\\ | ||
:parser: myst_parser.sphinx_\\ | ||
" changelog.rst | ||
- name: Commit changelog | ||
id: commit | ||
run: | | ||
if [[ `git status --porcelain` ]]; then | ||
echo ::set-output name=CHANGES::true | ||
git add ${{ steps.path.outputs.value }} | ||
echo "CHANGES=true" >> $GITHUB_OUTPUT | ||
git add docsrc/source/pages/reference/changelog/${{ steps.path.outputs.value }} | ||
git commit -m "[skip ci] Update changelogs" -a | ||
else | ||
echo ::set-output name=CHANGES::false | ||
echo "CHANGES=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Push changes | ||
|
@@ -89,6 +101,8 @@ jobs: | |
with: | ||
branch: ${{ github.ref }} | ||
github_token: ${{ secrets.ACCESS_TOKEN }} | ||
force: true | ||
|
||
|
||
prerelease-tag: | ||
if: needs.prepare.outputs.new_release == 'true' | ||
|
@@ -132,3 +146,4 @@ jobs: | |
release_name: ${{ needs.prepare.outputs.release }} | ||
body: ${{ needs.prepare.outputs.release_notes }} | ||
draft: true | ||
commitish: master |
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 |
---|---|---|
|
@@ -27,9 +27,9 @@ jobs: | |
|
||
- name: Configurating Git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git config --local core.autocrlf false | ||
git config user.email "[email protected]" | ||
git config user.name "Azory YData Bot" | ||
git config core.autocrlf false | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
|
@@ -62,16 +62,16 @@ jobs: | |
id: commit | ||
run: | | ||
if [[ `git status --porcelain --untracked-files=no` ]]; then | ||
echo ::set-output name=CHANGES::true | ||
echo "CHANGES=true" >> $GITHUB_OUTPUT | ||
git add -u | ||
git commit -m "[skip ci] Code formatting" -a | ||
else | ||
echo ::set-output name=CHANGES::false | ||
echo "CHANGES=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
if: ${{ steps.commit.outputs.CHANGES == 'true' }} | ||
if: always() && steps.commit.outputs.CHANGES == 'true' | ||
with: | ||
branch: ${{ github.head_ref }} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,10 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Version | ||
id: version | ||
run: echo "value=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
|
||
- name: Setup Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
|
@@ -42,9 +46,7 @@ jobs: | |
run: make lint | ||
|
||
- name: Build package | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine check dist/* | ||
run: make package version=${{ steps.version.outputs.value }} | ||
|
||
- name: Upload Pipeline Artifacts | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -96,9 +98,9 @@ jobs: | |
|
||
- name: Configurating Git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git config --local core.autocrlf false | ||
git config user.email "[email protected]" | ||
git config user.name "Azory YData Bot" | ||
git config core.autocrlf false | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
|
@@ -117,35 +119,27 @@ jobs: | |
|
||
- name: Update examples | ||
run: make examples | ||
env: | ||
KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }} | ||
KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }} | ||
|
||
- name: Build the documentation | ||
run: make docs | ||
|
||
- name: Create branch name | ||
run: | | ||
export BRANCH_NAME="${GITHUB_REF##*/}/" | ||
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | ||
- name: Move the changes to the gh-pages branch (release branch) | ||
run: | | ||
mv docs/ ${{ env.BRANCH_NAME }} | ||
mkdir docs/ | ||
mv ${{ env.BRANCH_NAME }} docs/${{ env.BRANCH_NAME }} | ||
mv examples/ ${{ env.BRANCH_NAME }} | ||
mkdir examples/ | ||
mv ${{ env.BRANCH_NAME }} examples/${{ env.BRANCH_NAME }} | ||
git add -f docs/${{ env.BRANCH_NAME }} | ||
git add -f examples/${{ env.BRANCH_NAME }} | ||
git stash push -- docs/ examples/${{ env.BRANCH_NAME }} | ||
mv docs master | ||
mkdir docs | ||
mv master docs/master | ||
mv examples/ master | ||
mkdir examples | ||
mv master examples/master | ||
git add -f docs/master | ||
git add -f examples/master | ||
git stash push -- docs/master examples/master | ||
git fetch origin gh-pages | ||
git checkout gh-pages | ||
git checkout -f gh-pages | ||
touch .nojekyll | ||
git add .nojekyll | ||
rm -rf docs/${{ env.BRANCH_NAME }} | ||
rm -rf examples/${{ env.BRANCH_NAME }} | ||
rm -rf docs/master | ||
rm -rf examples/master | ||
git add docs/ | ||
git add examples/ | ||
git stash apply | ||
|
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 |
---|---|---|
|
@@ -80,3 +80,7 @@ examples/*/*.csv | |
docs/ | ||
docsrc/_build/ | ||
docsrc/source/pages/api/_autosummary/ | ||
|
||
# User created | ||
VERSION | ||
version.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
"@semantic-release/release-notes-generator" | ||
] | ||
} |
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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
ignores: [(message) => message.includes('Merge branch') || message.includes('[skip ci]')], | ||
rules: { | ||
'body-max-line-length': [2, 'always', 120], | ||
'footer-max-line-length': [2, 'always', 120], | ||
}, | ||
}; | ||
}; |
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
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
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