diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6102506 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,86 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' # Only run for full release tags + +jobs: + + download_archives: + uses: ./.github/workflows/web_artifact.yaml + with: + name: 6s-archives + urls: | + [ + "https://web.archive.org/web/20220912090811if_/https://rtwilson.com/downloads/6SV-1.1.tar", + "https://web.archive.org/web/20220909154857if_/https://salsa.umd.edu/files/6S/6sV2.1.tar" + ] + retention-days: 1 + + build: + needs: download_archives + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + os: [ "windows-latest", "ubuntu-latest", "macos-latest" ] + python-version: [ "3.9", "3.10", "3.11" ] + include: + - os: ubuntu-latest + python-version: '3.11' + sdist: true + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up Fortran + uses: awvwgk/setup-fortran@v1 + + - name: Install build frontend + run: python -m pip install --upgrade pip build + + - name: Retrieve 6S source archives + uses: actions/download-artifact@v3 + with: + name: 6s-archives + path: 6s-archives + + - name: Build wheel + run: python -I -m build --wheel + env: + SIXS_ARCHIVE_DIR: 6s-archives + + - name: Build sdist + if: ${{ matrix.sdist }} + run: python -I -m build --sdist + + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + retention-days: 5 + if-no-files-found: error + + publish: + needs: build +# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Retrieve distributions + uses: actions/download-artifact@v3 + with: + name: dist + path: dist + + - name: Publish distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/README.md b/README.md index 79277b7..cce3bc8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # 6S Binary Distribution +[![release workflow](https://github.com/brianschubert/6s-bin/actions/workflows/release.yaml/badge.svg)](https://github.com/brianschubert/6s-bin/actions) [![tests workflow](https://github.com/brianschubert/6s-bin/actions/workflows/test.yaml/badge.svg)](https://github.com/brianschubert/6s-bin/actions) [![License](https://img.shields.io/github/license/brianschubert/6s-bin)](./LICENSE) [![Code style: black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/psf/black) diff --git a/pyproject.toml b/pyproject.toml index 180f8f8..b656268 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "6s-bin" -version = "0.7.0-dev" +version = "0.7.0.dev1" description = "Convenience distribution for building and installing local 6S executables." license = "Apache-2.0" authors = ["Brian Schubert "] @@ -17,8 +17,10 @@ packages = [ { from = "src", include = "sixs_bin" } ] include = [ - "src/sixs_bin/sixsV1.1", - "src/sixs_bin/sixsV2.1", + # Only include compiled 6S binaries in (platform-specific) wheel distributions. + # We don't want them in included in source distributions, since those may be used on different platforms. + { path = "src/sixs_bin/sixsV1.1", format = "wheel" }, + { path = "src/sixs_bin/sixsV2.1", format = "wheel" }, ] [tool.poetry.build]