fix: ignore NA when casting to datetime (#1391) #52
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
name: Merge into master branch | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
prepare: | |
name: Calculate Version and Build Number | |
runs-on: ubuntu-22.04 | |
outputs: | |
build_number: ${{ steps.build_number.outputs.value }} | |
new_release: ${{ steps.semantic.outputs.new_release_published }} | |
release: v${{ steps.semantic.outputs.new_release_version }} | |
release_notes: ${{ steps.semantic.outputs.new_release_notes }} | |
version: v${{ steps.version.outputs.value }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.ACCESS_TOKEN }} | |
- uses: cycjimmy/semantic-release-action@v3 | |
id: semantic | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
branch: master | |
dry_run: true | |
- name: Count number or releases for tag | |
id: build_number | |
run: echo "value=$(($(git tag | grep -c ${{ steps.semantic.outputs.new_release_version }}.rc) + 1))" >> $GITHUB_OUTPUT | |
- name: Compute version | |
id: version | |
run: echo "value=${{ steps.semantic.outputs.new_release_version }}.rc${{ steps.build_number.outputs.value }}" >> $GITHUB_OUTPUT | |
docs-changelog: | |
if: needs.prepare.outputs.new_release == 'true' | |
name: Update changelog on docs | |
runs-on: ubuntu-22.04 | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Calculate changelog path | |
id: path | |
run: echo "value=$(echo "${{ needs.prepare.outputs.release }}" | sed "s/\./_/g").md" >> $GITHUB_OUTPUT | |
- name: Configure Git | |
run: | | |
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: | | |
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 "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 "CHANGES=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Push changes | |
uses: ad-m/[email protected] | |
if: ${{ steps.commit.outputs.CHANGES == 'true' }} | |
with: | |
branch: ${{ github.ref }} | |
github_token: ${{ secrets.ACCESS_TOKEN }} | |
prerelease-tag: | |
if: needs.prepare.outputs.new_release == 'true' | |
name: Create Prerelease Tag | |
runs-on: ubuntu-22.04 | |
needs: | |
- prepare | |
steps: | |
- uses: ydataai/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
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-22.04 | |
needs: | |
- prepare | |
- docs-changelog | |
steps: | |
- name: Delete Previous drafts | |
uses: hugo19941994/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: Create Draft Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
with: | |
tag_name: ${{ needs.prepare.outputs.release }} | |
release_name: ${{ needs.prepare.outputs.release }} | |
body: ${{ needs.prepare.outputs.release_notes }} | |
draft: true | |
commitish: master | |