diff --git a/.github/workflows/create-release-and-upload-assets.yml b/.github/workflows/create-release-and-upload-assets.yml index 1aeba0f..2b82b17 100644 --- a/.github/workflows/create-release-and-upload-assets.yml +++ b/.github/workflows/create-release-and-upload-assets.yml @@ -54,7 +54,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: master + ref: main - name: git fetch --all run: | git config --global --add safe.directory /__w/openvpn-monitor/openvpn-monitor @@ -136,6 +136,11 @@ jobs: upload-package-to-pypi: needs: create-release runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/openvpn-monitor + permissions: + id-token: write steps: - uses: actions/checkout@v4 - name: Set up python @@ -144,9 +149,9 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + python3 -m pip install --upgrade pip + pip3 install setuptools wheel + - name: Build dists + run: python3 setup.py sdist bdist_wheel + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 40095bd..8f749e8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,11 +17,11 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + python3 -m pip install --upgrade pip + pip3 install -r requirements.txt - name: Lint with flake8 run: | - pip install flake8 + pip3 install flake8 # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide