mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2025-01-30 15:36:48 +00:00
add workflow
This commit is contained in:
parent
137e30edcc
commit
0ef7042a60
65
.github/workflows/python.yml
vendored
Normal file
65
.github/workflows/python.yml
vendored
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
name: Python Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Wheel
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: 'recursive'
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: "3.9"
|
||||||
|
|
||||||
|
- name: Install Python packages
|
||||||
|
run: python -m pip install --upgrade build pip
|
||||||
|
|
||||||
|
- name: build wheel
|
||||||
|
run: python -m build --wheel
|
||||||
|
|
||||||
|
- name: build sdist
|
||||||
|
run: python -m build --sdist
|
||||||
|
|
||||||
|
- name: Store the packages
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: python-package-distributions
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
pypi:
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
needs:
|
||||||
|
- test
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download all the dists
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: python-package-distributions
|
||||||
|
path: dist/
|
||||||
|
|
||||||
|
- name: Publish 📦 to TestPyPI
|
||||||
|
if: ${{ github.ref == 'refs/heads/patcher' }}
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
with:
|
||||||
|
password: ${{ secrets.testpypi_password }}
|
||||||
|
repository_url: https://test.pypi.org/legacy/
|
||||||
|
|
||||||
|
- name: Publish 📦 to PyPI
|
||||||
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
with:
|
||||||
|
password: ${{ secrets.pypi_password }}
|
Loading…
Reference in a new issue