Skip to content

Commit

Permalink
OPS: Use new versions of GitHub actions in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Dec 20, 2022
1 parent 3b12510 commit 8ade508
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,51 @@ jobs:
python: [3.8]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install tox
run: pip install tox

- name: Run tests
run: tox

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: coverage.xml
files: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

publish:
if: "!contains(github.event.head_commit.message, 'skipci')"
runs-on: ubuntu-latest
needs: [check-semantic-version, run-tests]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Make package
run: |
python3 -m pip install --upgrade setuptools wheel
python3 setup.py sdist bdist_wheel
- name: Test package is publishable with PyPI test server
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish latest package to PyPI
if: contains(github.ref, 'main')
uses: pypa/gh-action-pypi-publish@master
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get package version
run: echo "PACKAGE_VERSION=$(python setup.py --version)" >> $GITHUB_ENV

- name: Create Release
uses: actions/create-release@v1
env:
Expand Down

0 comments on commit 8ade508

Please sign in to comment.