2. Build and Publish #5
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: 2. Build and Publish | |
on: | |
workflow_run: | |
workflows: ["1. Bump Version"] | |
types: | |
- completed | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
# test: | |
# name: 2.1. Test | |
# runs-on: ubuntu-22.04 | |
# permissions: | |
# contents: read | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# - name: Set up Python | |
# uses: actions/setup-python@v3 | |
# with: | |
# python-version: "3.9" | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install -U pip | |
# python -m pip install -r ./requirements.test.txt | |
# - name: Test with pytest | |
# run: ./scripts/test.sh -l | |
build_publish: | |
# needs: test | |
name: 2.2. Build and Publish | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install -r ./requirements.build.txt | |
- name: Build and publish package | |
# run: | | |
# echo -e "[testpypi]\nusername = __token__\npassword = ${{ secrets.TEST_PYPI_API_TOKEN }}" > ~/.pypirc | |
# ./scripts/build.sh -c -u | |
# rm -rfv ~/.pypirc | |
run: | | |
echo -e "[pypi]\nusername = __token__\npassword = ${{ secrets.PYPI_API_TOKEN }}" > ~/.pypirc | |
./scripts/build.sh -c -u -p | |
rm -rfv ~/.pypirc | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create v$(./scripts/get-version.sh) ./dist/* --generate-notes |