From e798abb6cc01a8a5f108d8c7b34e142d36e2a49c Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Thu, 14 Mar 2024 15:52:48 -0700 Subject: [PATCH 1/3] create pypi-release.yml --- .github/workflows/pypi-release.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/pypi-release.yml diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..40167fd --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,29 @@ +name: Release to PyPi + +on: + release: + types: [published] + +jobs: + publish_to_pypi: + runs-on: ubuntu-latest + environment: release # configured in repo Settings/Environments; referenced in PyPI OIDC + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.11' # numpy is a problem with 3.12 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install poetry + poetry config virtualenvs.create false # tell poetry not to create a new virtual environment + poetry self add "poetry-dynamic-versioning[plugin]" + - name: Build package with poetry + run: | + poetry build -f wheel + poetry build -f sdist + - name: Publish to PyPI with pypi-publish (trusted publishing) + uses: pypa/gh-action-pypi-publish@v1.8.5 From 79c9aa5f8cfe883865c8bd34fe5bac96047c0a51 Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Mon, 18 Mar 2024 15:45:53 -0700 Subject: [PATCH 2/3] add github-release on tag --- .github/workflows/github-release.yml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/github-release.yml diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml new file mode 100644 index 0000000..99c246a --- /dev/null +++ b/.github/workflows/github-release.yml @@ -0,0 +1,41 @@ +name: Create Github Release + +on: + push: + tags: + - "*.*.*" + - "*.*.*-alpha.*" + - "*.*.*-beta.*" + - "*.*.*-rc.*" + +jobs: + run_tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install poetry + poetry install + - name: Run tests + run: poetry run python tom_fink/tests/run_tests.py + + create_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: true From 3e0b88037f601925dbea454840dc2d4d3f09d1bf Mon Sep 17 00:00:00 2001 From: Joey Chatelain Date: Mon, 18 Mar 2024 15:58:13 -0700 Subject: [PATCH 3/3] add 3.11 to python version tests on release --- .github/workflows/github-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 99c246a..96063b7 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest] steps: - uses: actions/checkout@v2