Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/buildUltraplot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Test
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v2.0.3
with:
environment-file: ./environment-dev.yml
init-shell: bash
create-args: --verbose
cache-environment: true
cache-downloads: false

- name: Test Ultraplot
shell: bash -el {0}
run: |
micromamba activate ultraplot-dev
pip install .
python -m pytest

- name: "Build docs"
shell: bash -el {0}
run: |
micromamba activate ultraplot-dev
cd docs
make html
Original file line number Diff line number Diff line change
@@ -1,74 +1,10 @@
name: Build and Test
name: Publish to Conda
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v2.0.3
with:
environment-file: ./environment-dev.yml
init-shell: >-
bash
create-args: >-
--verbose
cache-environment: true
cache-downloads: false

- name: Test Ultraplot
shell: bash -el {0}
run: |
micromamba activate ultraplot-dev
pip install .
python -m pytest

- name: "Build docs"
shell: bash -el {0}
run: |
micromamba activate ultraplot-dev
cd docs
make html

publish-test:
needs: build
runs-on: ubuntu-latest
# Run on every push to main/v* branches and pull requests
if: github.event_name == 'push' || github.event_name == 'pull_request'
permissions:
id-token: write
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install build
run: python -m pip install build

- name: Build package
run: python -m build

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish:
jobs:
publish-conda:
needs: [build, publish-test]
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish to PyPI
on:
release:
types: [published]
push:
tags: ["v*"]

jobs:
publish-pypi-test:
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Build package
run: |
python -m pip install build
python -m build
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-prod:
needs: publish-test
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Build package
run: |
python -m pip install build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading