-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: follow guidelines for deploy (#36)
* ci: follow guidelines for deploy * ci: add standard deploy
- Loading branch information
Showing
2 changed files
with
46 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: CD | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
dist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Build wheel and SDist | ||
run: pipx run build | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: dist/* | ||
|
||
- name: Check metadata | ||
run: pipx run twine check dist/* | ||
|
||
|
||
publish: | ||
needs: [dist] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.pypi_password }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,7 @@ name: CI | |
on: | ||
pull_request: | ||
push: | ||
branches: master | ||
tags: | ||
- 'v*' | ||
branches: [master] | ||
|
||
|
||
jobs: | ||
|
@@ -15,9 +13,9 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected].0 | ||
- uses: pre-commit/[email protected].2 | ||
- name: Check manifest | ||
uses: pre-commit/[email protected].0 | ||
uses: pre-commit/[email protected].2 | ||
with: | ||
extra_args: --hook-stage manual check-manifest | ||
|
||
|
@@ -46,35 +44,3 @@ jobs: | |
|
||
- name: Test package | ||
run: python -m pytest --cov hepunits | ||
|
||
dist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install wheel and sdist requirements | ||
run: python -m pip install "setuptools>=42.0" "setuptools_scm[toml]>=3.4" "wheel" | ||
|
||
- name: Build sdist | ||
run: python setup.py sdist | ||
|
||
- name: Build wheel | ||
run: > | ||
python -m pip wheel . -w wheels && | ||
ls -lh wheels && | ||
mkdir -p dist && | ||
cp wheels/hepunits*any.whl dist/ | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: DistPackage | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |