Skip to content

Commit 6b8223a

Browse files
authored
Merge pull request #4 from cvanelteren/conda
Workflows for build and test, doc building, and pypi uploads
2 parents 0089fe0 + fa1f2fc commit 6b8223a

File tree

4 files changed

+101
-159
lines changed

4 files changed

+101
-159
lines changed

.github/workflows/build-docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build docs
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: mamba-org/setup-micromamba@v2.0.3
15+
with:
16+
environment-file: ./environment-dev.yml
17+
init-shell: bash
18+
create-args: --verbose
19+
cache-environment: true
20+
cache-downloads: false
21+
22+
- name: "Build docs"
23+
shell: bash -el {0}
24+
run: |
25+
micromamba activate ultraplot-dev
26+
pip install .
27+
cd docs
28+
make html
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and Test
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: mamba-org/setup-micromamba@v2.0.3
15+
with:
16+
environment-file: ./environment-dev.yml
17+
init-shell: bash
18+
create-args: --verbose
19+
cache-environment: true
20+
cache-downloads: false
21+
22+
- name: Test Ultraplot
23+
shell: bash -el {0}
24+
run: |
25+
micromamba activate ultraplot-dev
26+
pip install .
27+
python -m pytest

.github/workflows/publish-pypi.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types: [published]
5+
push:
6+
tags: ["v*"]
7+
8+
jobs:
9+
publish-pypi-test:
10+
runs-on: ubuntu-latest
11+
if: github.event_name == 'push'
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.x"
20+
- name: Build package
21+
run: |
22+
python -m pip install build
23+
python -m build
24+
- name: Publish to TestPyPI
25+
uses: pypa/gh-action-pypi-publish@release/v1
26+
with:
27+
repository-url: https://test.pypi.org/legacy/
28+
29+
publish-prod:
30+
needs: publish-test
31+
runs-on: ubuntu-latest
32+
if: github.event_name == 'release'
33+
permissions:
34+
id-token: write
35+
contents: read
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: actions/setup-python@v4
39+
with:
40+
python-version: "3.x"
41+
- name: Build package
42+
run: |
43+
python -m pip install build
44+
python -m build
45+
- name: Publish to PyPI
46+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/ultraplot.yml

Lines changed: 0 additions & 159 deletions
This file was deleted.

0 commit comments

Comments
 (0)