fix: add path to version manifest #95
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
name: release-please | |
on: | |
release: | |
types: | |
- published | |
- released | |
push: | |
pull_request: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
# linting: | |
# name: Linting | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# pip install black ruff | |
# - name: Autoformat with black | |
# run: | | |
# black . | |
# - name: Lint with ruff | |
# run: | | |
# ruff check LoopProjectFile --fix | |
# - uses: stefanzweifel/git-auto-commit-action@v5 | |
# with: | |
# commit_message: "style: style fixes by ruff and autoformatting by black" | |
pip-build-sdist: | |
name: Build SDist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build SDist | |
run: | | |
pip install build | |
python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: loopprojectfile-dist | |
path: dist/*.tar.gz | |
compression-level: 0 | |
pip-test-sdist: | |
name: Test sdist | |
needs: pip-build-sdist | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create virtual environment | |
# install uv and use it to create a virtual environment, then add it to | |
# environment variables so that it is automatically activated and can be | |
# used for tests below | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
. $HOME/.cargo/env | |
uv venv .venv | |
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV | |
echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
- name: Download sdist from artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: loopprojectfile-dist | |
path: dist | |
- name: Build LPF from sdist and install test dependencies | |
shell: bash | |
run: | | |
uv pip install --no-cache dist/*.tar.gz | |
uv pip install netCDF4>=1.5.4 numpy pandas pytest | |
uv pip list | |
pip-build-wheels: | |
needs: [pip-build-sdist, pip-test-sdist] | |
name: Build Wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Wheels | |
run: | | |
pip install netCDF4>=1.5.4 --only-binary :all: | |
pip install build numpy pandas pytest | |
python -m build --wheel | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: loopprojectfile-wheels-${{ matrix.os }} | |
path: dist/*.whl | |
compression-level: 0 | |
pip-test-wheels: | |
name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | |
needs: pip-build-wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
include: | |
- os: "ubuntu-latest" | |
artifact: loopprojectfile-wheels-ubuntu-latest | |
- os: "macos-latest" | |
artifact: loopprojectfile-wheels-macos-latest | |
- os: "windows-latest" | |
artifact: loopprojectfile-wheels-windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Create virtual environment (Linux / MacOS) | |
# install uv and use it to create a virtual environment, then add it to | |
# environment variables so that it is automatically activated and can be | |
# used for tests below | |
if: ${{ runner.os != 'Windows' }} | |
shell: bash | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
. $HOME/.cargo/env | |
uv venv .venv | |
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV | |
echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
- name: Create virtual environment (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
run: | | |
irm https://astral.sh/uv/install.ps1 | iex | |
uv venv .venv | |
"VIRTUAL_ENV=.venv" | Out-File -FilePath $env:GITHUB_ENV -Append | |
"$PWD/.venv/Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append | |
- name: Download wheels from artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.artifact }} | |
path: dist | |
- name: Install dependencies and LoopProjectFile wheel | |
shell: bash | |
run: | | |
uv pip install --upgrade pip | |
uv pip install netCDF4>=1.5.4 --only-binary :all: | |
uv pip install numpy pandas pytest | |
uv pip install --no-cache --pre --no-index --find-links dist loopprojectfile | |
uv pip list | |
conda-build: | |
name: Conda Build-Deploy ${{ matrix.os }} - Python Version-${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Miniforge | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
activate-environment: anaconda-client-env | |
use-only-tar-bz2: true | |
- name: Cache/Restore Cygwin - Windows Only | |
if: runner.os == 'Windows' | |
uses: actions/cache@v4 | |
with: | |
path: C:/cygwin64 | |
key: cygwin-${{ runner.os }}-${{ matrix.python-version }} | |
restore-keys: | | |
cygwin-${{ runner.os }}- | |
# setup.rc seems to be missing when cygwin installed | |
- name: Install Cygwin | |
if: ${{runner.os == 'Windows'}} | |
shell: pwsh | |
run: | | |
# Download Cygwin installer | |
curl -L -o cygwin-installer.exe https://cygwin.com/setup-x86_64.exe | |
# Install Cygwin with the default base packages (including cygpath) | |
.\cygwin-installer.exe -q -n -N -d -R C:\cygwin64 | |
echo "C:\cygwin64\bin" | Out-File -Append -Encoding ASCII $env:GITHUB_PATH | |
echo "MSYSTEM=CYGWIN" >> $GITHUB_ENV | |
- name: Installing Dependencies | |
shell: bash -l {0} | |
run: | | |
conda install -c conda-forge conda-build anaconda-client conda-verify -y | |
conda install -c conda-forge -c loop3d --file requirements.txt -y | |
- name: Building and install | |
shell: bash -l {0} | |
run: | | |
pip install . --user | |
- name: update submodules | |
shell: bash | |
run: | | |
git submodule update --init --recursive | |
- name: Conda Build | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
path: ~/conda_pkgs_dir | |
shell: bash -l {0} | |
run: | | |
conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }} | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }} | |
path: conda | |
release-please: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
config-file: 'release-please-config.json' | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
#if a release is created then run the deploy scripts for github.io, conda, pypi and docker | |
conda-upload: | |
needs: [release-please, conda-build] | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }} | |
path: conda | |
- uses: conda-incubator/setup-miniconda@v3 | |
- name: upload all files to conda-forge | |
shell: bash -l {0} | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
with: | |
skip-existing: true | |
verbose: true | |
run: | | |
conda install -c anaconda anaconda-client -y | |
anaconda upload --label main conda/*/*.tar.bz2 | |
pypi-upload: | |
needs: [release-please, pip-test-wheels] | |
runs-on: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
if: ${{ needs.release-please.outputs.release_created }} | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: loopprojectfile-dist | |
path: dist/ | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
verbose: true |