Skip to content

Commit

Permalink
add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
itrharrison committed Jul 5, 2024
1 parent df7ca28 commit 52f2717
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Upload to TestPyPI

on:
release:
types: [published]

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

testpypi-publish:
name: Upload release to Test-PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# user: __token__
repository-url: https://test.pypi.org/legacy/
# print-hash: true
# password: ${{ secrets.TEST_PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ include = [
"*" = ['*.yaml', '*.fits', '*.txt', '*.pkl', '*.gz']

[tool.setuptools_scm]
version_file = "soliket/version.py"
version_file = "soliket/_version.py"

[project.optional-dependencies]
all = [
Expand Down

0 comments on commit 52f2717

Please sign in to comment.