Skip to content

Fixing the gh action 3: #42

Fixing the gh action 3:

Fixing the gh action 3: #42

name: PyPi release
on: [push, workflow_dispatch]
jobs:
build:
name: PyPi release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install environment requirements
run: >-
python -m
pip install
-r
requirements.txt
- name: Run UTs
run: >-
python -m
unittest
discover
-v
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Bump patch version
run: >-
python -c "from onepassword.utils import bump_version; bump_version(version_type='patch')"
- name: Build a source tarball
run: >-
python -m
build
--sdist
--outdir dist/
.
pypi-publish:
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Publish distribution 📦 to Test PyPI
# Specifying a GitHub environment is optional, but strongly encouraged
if: ${{ github.ref != 'refs/heads/main' }}
environment: test

Check failure on line 51 in .github/workflows/publish-to-pypi.yml

View workflow run for this annotation

GitHub Actions / PyPi release

Invalid workflow file

The workflow is not valid. .github/workflows/publish-to-pypi.yml (Line: 51, Col: 7): Unexpected value 'environment' .github/workflows/publish-to-pypi.yml (Line: 57, Col: 7): Unexpected value 'environment'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: ${{ github.ref == 'refs/heads/main' }}
environment: release
uses: pypa/gh-action-pypi-publish@release/v1
- name: Add, commit and push version update
if: ${{ github.ref == 'refs/heads/main' }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git checkout main
git add .
git commit -m "[actions skip] GitHub bumping the version"
git push