未验证 提交 e40c5838 编写于 作者: F Frost Ming 提交者: GitHub

Merge pull request #59 from frostming/improve-ci

add release pipeline
......@@ -16,13 +16,13 @@ jobs:
run: |
pip install pre-commit
pre-commit run --all-files
UnixTesting:
Testing:
needs: Linting
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8]
os: [ubuntu-latest, macOS-latest]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
......@@ -32,36 +32,24 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Cache packages
uses: actions/cache@v1
with:
path: __pypackages__
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ matrix.os }}-packages-${{ matrix.python-version }}-${{ hashFiles('pdm.lock') }}
- name: Install editable PDM
run: |
pip install wheel
python setup_dev.py
- name: Test
- name: Test Unix
if: matrix.os != 'windows-latest'
shell: bash
run: |
pdm="__pypackages__/${{ matrix.python-version }}/bin/pdm"
$pdm run pytest -n auto tests
WindowsTesting:
needs: Linting
runs-on: windows-latest
strategy:
matrix:
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install editable PDM
run: |
pip install wheel
python setup_dev.py
- name: Test
- name: Test Windows
if: matrix.os == 'windows-latest'
run: |
Set-Variable -Name pdm -Value "__pypackages__/${{ matrix.python-version }}/Scripts/pdm"
& $pdm run pytest -n auto tests
name: Release
on:
push:
tags:
- v*
jobs:
release-pypi:
name: release-pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.7
architecture: 'x64'
- name: Cache packages
uses: actions/cache@v1
with:
path: __pypackages__
# Look to see if there is a cache hit for the corresponding requirements file
key: release-packages-${{ hashFiles('pdm.lock') }}
- name: Install editable PDM
run: |
pip install wheel
python setup_dev.py
- name: Build artifacts
run: |
__pypackages__/3.7/bin/pdm build -v
- name: Test Build
run: |
python3 -m venv fresh_env
. fresh_env/bin/activate
pip install dist/*.whl
pdm --help
- name: Upload to Pypi
run: |
pip install twine
twine upload --username __token__ --password ${{ secrets.PYPI_TOKEN }} dist/*
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册