|
6 | 6 | - '[0-9]+.[0-9]+.[0-9]+' |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - packge-and-upload: |
10 | | - name: "π€ Call SDK publish workflow" |
11 | | - uses: clamsproject/.github/.github/workflows/sdk-publish.yml@main |
12 | | - secrets: inherit |
13 | | - |
| 9 | + build-and-upload: |
| 10 | + name: "π¦ Upload documentation, PyPI distribution" |
| 11 | + runs-on: ubuntu-latest |
| 12 | + env: |
| 13 | + OS: linux |
| 14 | + PYTHON: '3.10' |
| 15 | + steps: |
| 16 | + - name: "π· Prepare package metadata" |
| 17 | + run: | |
| 18 | + echo "VERSION=$(echo "${{ github.ref }}" | cut -d/ -f3)" >> $GITHUB_ENV |
| 19 | + echo "PACKAGE=$(echo "${{ github.repository }}" | cut -d/ -f2 | tr '-' '_')" >> $GITHUB_ENV |
| 20 | + - name: "π Checkout repository" |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + ref: ${{ env.VERSION }} |
| 24 | + fetch-depth: 0 |
| 25 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + - name: "π Setup Python" |
| 27 | + uses: actions/setup-python@v4 |
| 28 | + with: |
| 29 | + python-version: '3.10' |
| 30 | + - name: "π Build sdist" |
| 31 | + run: | |
| 32 | + echo ${{ env.VERSION }} > VERSION |
| 33 | + python3 -c "import setuptools; print(setuptools.__version__)" |
| 34 | + python3 -m pip install setuptools~=69.3 # this version fully conforms PEP-625 and applies wheel name convention to sdist as well |
| 35 | + make package |
| 36 | + make test |
| 37 | + - name: "ποΈ Build HTML documentation" |
| 38 | + run: | |
| 39 | + make docs |
| 40 | + - name: "π Generate changelog" |
| 41 | + run: | |
| 42 | + for pr in $(gh pr list -L 1000 -s merged | grep -E "^[0-9]+\s+releas" | cut -f 1 ); do gh pr view $pr --json title,body,mergedAt --template '{{printf "\n"}}## {{.title}} ({{timefmt "2006-01-02" .mergedAt}}){{printf "\n"}}{{.body}}{{printf "\n"}}'; done > CHANGELOG.md |
| 43 | + env: |
| 44 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + - name: "π« Commit and push documentation files" |
| 46 | + run: | |
| 47 | + git config --local user.email "admin@clams.ai" |
| 48 | + git config --local user.name "clams-bot" |
| 49 | + for f in docs documentation CHANGELOG.md; do if [ -e $f ]; then git add $f; fi; done |
| 50 | + git add -u docs |
| 51 | + git commit -m 'adding HTML documentation for publication' |
| 52 | + git push origin HEAD:main |
| 53 | + - name: "βοΈ Upload to PyPI" |
| 54 | + run: | |
| 55 | + if [ -d dist ]; then twine upload -u __token__ -p ${{ secrets.PYPITOKEN }} dist/${{ env.PACKAGE }}-${{ env.VERSION }}.tar.gz ; fi |
0 commit comments