Skip to content

Commit c2a9655

Browse files
committed
separated workflows
separated workflows separated workflows
1 parent 5609372 commit c2a9655

File tree

3 files changed

+83
-67
lines changed

3 files changed

+83
-67
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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/[email protected]
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
28+
29+
- name: "Build docs"
30+
shell: bash -el {0}
31+
run: |
32+
micromamba activate ultraplot-dev
33+
cd docs
34+
make html

.github/workflows/ultraplot.yml renamed to .github/workflows/publish-conda.yml

Lines changed: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,10 @@
1-
name: Build and Test
1+
name: Publish to Conda
22
on:
3-
push:
4-
branches: [main]
5-
tags: ["v*"]
6-
pull_request:
7-
branches: [main]
83
release:
94
types: [published]
10-
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
timeout-minutes: 15
14-
steps:
15-
- uses: actions/checkout@v3
16-
- uses: mamba-org/[email protected]
17-
with:
18-
environment-file: ./environment-dev.yml
19-
init-shell: >-
20-
bash
21-
create-args: >-
22-
--verbose
23-
cache-environment: true
24-
cache-downloads: false
25-
26-
- name: Test Ultraplot
27-
shell: bash -el {0}
28-
run: |
29-
micromamba activate ultraplot-dev
30-
pip install .
31-
python -m pytest
32-
33-
- name: "Build docs"
34-
shell: bash -el {0}
35-
run: |
36-
micromamba activate ultraplot-dev
37-
cd docs
38-
make html
39-
40-
publish-test:
41-
needs: build
42-
runs-on: ubuntu-latest
43-
# Run on every push to main/v* branches and pull requests
44-
if: github.event_name == 'push' || github.event_name == 'pull_request'
45-
permissions:
46-
id-token: write
47-
contents: read
48-
49-
steps:
50-
- name: Checkout repository
51-
uses: actions/checkout@v3
52-
with:
53-
fetch-depth: 0
54-
55-
- name: Set up Python
56-
uses: actions/setup-python@v4
57-
with:
58-
python-version: "3.x"
59-
60-
- name: Install build
61-
run: python -m pip install build
62-
63-
- name: Build package
64-
run: python -m build
655

66-
- name: Publish to TestPyPI
67-
uses: pypa/gh-action-pypi-publish@release/v1
68-
with:
69-
repository-url: https://test.pypi.org/legacy/
70-
71-
publish-conda-pypi:
6+
jobs:
7+
publish-conda:
728
needs: [build, publish-test]
739
runs-on: ubuntu-latest
7410
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')

.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

0 commit comments

Comments
 (0)