Update master.yml #8
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: CI | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
validate-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: pip install pytest | |
- name: Run test cases | |
run: pytest | |
deploy-to-pypi: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: pip install build twine | |
- name: Build the project | |
run: python -m build | |
- name: Check the build | |
run: twine check dist/* | |
- name: Publish to test PyPI | |
run: twine upload -r testpypi dist/* -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} | |
- name: Publish to PyPI | |
run: twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} | |
- name: Output new version | |
id: meta | |
run: | | |
echo "version=$(python -c 'import nepali_datetime; print(nepali_datetime.__version__)')" >> $GITHUB_OUTPUT | |
- name: Create a new github release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.meta.outputs.version }} | |
name: Release ${{ steps.meta.outputs.version }} |