Skip to content

Commit

Permalink
add refined deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaminsk committed Feb 21, 2024
1 parent 794b6f9 commit 914ffd5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 14 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: deploy to pypi

on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
deploy:
name: deploy
permissions:
id-token: write
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11

- name: install build dependencies
run: python3 -m pip install build

- name: build package
run: python3 -m build --sdist --wheel --outdir dist/

- name: upload package
uses: actions/upload-artifact@v4
with:
name: package
path: dist/

- name: publish package (pypi)
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: "https://pypi.org/legacy/"

- name: publish package (test.pypi)
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: "https://test.pypi.org/legacy/"
21 changes: 7 additions & 14 deletions .github/workflows/ci-test.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Run CI tests
name: run CI test

on:
push:
branches:
- main
- master
branches: [devel, main, master, wip]
pull_request:

env:
Expand All @@ -17,23 +15,18 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- name: "checkout repository"
uses: actions/checkout@v3

- name: "setup python 3.9"
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9

- name: "setup python 3.11"
uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11

- name: install nox
- name: install requirements
run: python -m pip install nox

- name: run tests
Expand Down

0 comments on commit 914ffd5

Please sign in to comment.