From ec87ca049a431337d50dce208213d1606b6795d9 Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 16 Sep 2024 05:54:41 +0800 Subject: [PATCH] build wheel for pypi package --- .github/workflows/milestone-publish.yml | 8 ++++---- tools/release-all.sh | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/milestone-publish.yml b/.github/workflows/milestone-publish.yml index 93f72ec36..54dcb3229 100644 --- a/.github/workflows/milestone-publish.yml +++ b/.github/workflows/milestone-publish.yml @@ -52,14 +52,14 @@ jobs: git remote add trigger git@js-beautify-github.com:beautifier/js-beautify.git git fetch --all - name: Install python twinE - run: pip install twine + run: pip install twine wheel - name: Run release script for ${{ github.event.milestone.title }} - env: + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SSH_AUTH_SOCK: /tmp/ssh_agent.sock MILESTONE_VERSION: ${{ github.event.milestone.title }} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - TWINE_USERNAME: ${{secrets.PYPI_USERNAME}} - TWINE_PASSWORD: ${{secrets.PYPI_PASSWORD}} + TWINE_USERNAME: ${{secrets.PYPI_USERNAME}} + TWINE_PASSWORD: ${{secrets.PYPI_PASSWORD}} run: | ./tools/release-all.sh ${MILESTONE_VERSION} diff --git a/tools/release-all.sh b/tools/release-all.sh index 07ff005c2..28edf91cc 100755 --- a/tools/release-all.sh +++ b/tools/release-all.sh @@ -17,13 +17,13 @@ release_python() git fetch --all || exit 1 git checkout -B staging/release origin/staging/release - git clean -xfd || exit 1 + git clean -xfd || exit 1 cd python # python setup.py register -r pypi cp setup-js.py setup.py || exit 1 - python setup.py sdist || exit 1 + python setup.py sdist bdist_wheel || exit 1 cp setup-css.py setup.py || exit 1 - python setup.py sdist || exit 1 + python setup.py sdist bdist_wheel || exit 1 rm setup.py || exit 1 python -m twine upload dist/* || exit 1 } @@ -57,7 +57,7 @@ release_web() git checkout -B staging/main site/staging/main || exit 1 git reset --hard site/main || exit 1 git merge origin/staging/main --no-edit || exit 1 - git push || exit 1 + git push || exit 1 } sedi() { @@ -113,7 +113,7 @@ update_release_branch() git add -f js/test/generated/ git add -f python/jsbeautifier/tests/generated/ git add -f python/cssbeautifier/tests/generated/ - + git commit -m "Release: $NEW_VERSION" git tag "v$NEW_VERSION" || exit 1 git push || exit 1 @@ -130,7 +130,7 @@ main() if [[ ! $NEW_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9].*$ ]]; then echo Version number must start with MAJOR.MINOR.INCREMENTAL numbering. exit 1 - fi + fi npm --version > /dev/null || { echo ERROR: npm must be installed before attempting release