Skip to content

Commit

Permalink
Add automated publishing (#177)
Browse files Browse the repository at this point in the history
* rc1 ver

* add publish workflow

* switch from test to pypi

* update publish.yaml names
  • Loading branch information
itrharrison authored Jul 9, 2024
1 parent 53a2729 commit 3e67d03
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Upload to PyPI

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 PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/soliket
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 PyPI
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 }}
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[project]
name = "soliket"
# version = "0.1.dev1"
dynamic = ['version']
authors = [
{name = "Simons Observatory"}
Expand Down Expand Up @@ -62,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 3e67d03

Please sign in to comment.