fix repr of LayerLimit and MagneticLayerLimit in flayer.py #20
Workflow file for this run
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: Publish to PyPI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
release: | |
types: [published] | |
jobs: | |
# Build a pure Python wheel and upload as an artifact | |
build-wheel: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
path: refl1d | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: build refl1d webview | |
run: | | |
python -m pip install -e ./refl1d | |
python -m refl1d.webview.build_client --mode=production | |
- name: Install dependencies for building the wheel | |
run: | | |
python -m pip install build | |
- name: Create the wheel | |
run: python -m build refl1d | |
- name: Upload the wheel artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: | | |
refl1d/dist/refl1d-*-py3-none-any.whl | |
refl1d/refl1d/webview/client/*.tgz | |
update-release: | |
needs: build-wheel | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Retrieve all artifacts | |
uses: actions/download-artifact@v4 | |
- name: show files | |
run: | | |
ls -R artifacts | |
echo "PY3_WHL=$(ls artifacts/dist/*.whl)" >> $GITHUB_ENV | |
echo "PY3_WHL=$(ls artifacts/dist/*.whl)" | |
- name: Update unstable release assets and text | |
uses: actions/github-script@v7 | |
env: | |
SEARCH_PATTERN: "artifacts/*" | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const script = require('./.github/actions/update_unstable.js'); | |
const output = await script({github, context, glob}); | |
console.log(output); | |
- name: Update current release | |
if: startsWith(github.ref, 'refs/tags') | |
uses: johnwbyrd/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
${{ env.PY3_WHL }} | |
publish: | |
needs: build-wheel | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Retrieve all artifacts | |
uses: actions/download-artifact@v4 | |
- name: publish distribution to Test PyPI | |
env: | |
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
if: env.TEST_PYPI_API_TOKEN != null | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
packages-dir: artifacts/dist/ | |
- name: Publish distribution to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: artifacts/dist/ |