release v1.8.4 #61
Workflow file for this run
This file contains hidden or 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: Release | |
| # https://github.community/t/how-to-run-github-actions-workflow-only-for-new-tags/16075/22 | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@master | |
| - name: Set up Python 3 | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: 3.12 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '22' | |
| - name: Build frontend | |
| working-directory: ./webiojs | |
| run: | | |
| npm install | |
| npx gulp | |
| cp dist/pywebio.min.js ../pywebio/html/js | |
| - name: PyPi Upload | |
| run: | | |
| pip3 install twine setuptools | |
| python3 setup.py sdist | |
| twine upload --username "__token__" --disable-progress-bar --verbose dist/* | |
| env: | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| - name: Set tag | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
| - name: Push asset | |
| run: | | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "${{ github.actor }}" | |
| git config --global credential.helper '!f() { sleep 1; echo "username=${{ github.actor }}"; echo "password=${GH_TOKEN}"; }; f' | |
| git clone https://github.com/wang0618/pywebio-assets.git | |
| rm -rf pywebio-assets/* | |
| cp -r pywebio/html/* pywebio-assets | |
| cd pywebio-assets | |
| git add . | |
| git commit -m "Build from https://github.com/wang0618/PyWebIO/commit/$GITHUB_SHA" || true | |
| git tag $RELEASE_VERSION | |
| git push -u origin --tags | |
| git push -u origin || true | |
| env: | |
| GH_TOKEN: ${{ secrets.ASSET_REPO_TOKEN }} |