Skip to content

Commit 5173675

Browse files
committed
fixed publish GHA for new min py version
1 parent 5895168 commit 5173675

File tree

1 file changed

+47
-5
lines changed

1 file changed

+47
-5
lines changed

β€Ž.github/workflows/publish.ymlβ€Ž

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,50 @@ on:
66
- '[0-9]+.[0-9]+.[0-9]+'
77

88
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

Comments
Β (0)