update the pypi version 0.0.2 #9
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 | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| jobs: | |
| check-version: | |
| name: Check Version | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| local-version: ${{ steps.get-local-version.outputs.version }} | |
| remote-version: ${{ steps.get-remote-version.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Get Local Version | |
| id: get-local-version | |
| run: echo "version=$(grep -oP '__version__ = "\K[^"]+' naver/_version.py)" >> $GITHUB_OUTPUT | |
| - name: Get Remote Version | |
| id: get-remote-version | |
| run: echo "version=$(curl -s https://pypi.org/pypi/naver/json | jq -r '.info.version')" >> $GITHUB_OUTPUT | |
| release: | |
| runs-on: ubuntu-22.04 | |
| needs: check-version | |
| if: needs.check-version.outputs.local-version != needs.check-version.outputs.remote-version | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| contents: write # For creating GitHub releases | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade pip | |
| pip install setuptools wheel twine build | |
| - name: Build package for naver | |
| run: python setup.py sdist bdist_wheel | |
| - name: Release naver to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| - name: Get the version | |
| run: | | |
| VER=$(grep -oP '__version__ = "\K[^"]+' naver/_version.py) | |
| echo "VERSION=$VER" >> $GITHUB_ENV | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: "${{ env.VERSION }}" | |
| name: "[${{ env.VERSION }}] NAVER Release" | |
| draft: true | |
| files: "dist/*" | |
| generate_release_notes: true |