Skip to content

Commit 3cfd948

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-5
2 parents 9212866 + 7c1cc83 commit 3cfd948

File tree

8 files changed

+3341
-1264
lines changed

8 files changed

+3341
-1264
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Deploy
22

33
on:
44
workflow_dispatch:
5+
push:
6+
tags: ["v*"]
57

68
jobs:
7-
deploy:
9+
conda-deploy:
810
runs-on: ubuntu-latest
911
steps:
1012
- uses: actions/checkout@v5
@@ -16,10 +18,34 @@ jobs:
1618
with:
1719
pixi-version: v0.48.1
1820

19-
- name: Build and Publish
21+
- name: Build and Publish Conda Package
22+
env:
23+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
24+
run: |
25+
pixi run conda-publish
26+
27+
pypi-deploy:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Set up pixi
35+
uses: prefix-dev/[email protected]
36+
with:
37+
pixi-version: v0.48.1
38+
39+
- name: Build and Publish PyPI Package
2040
env:
2141
TWINE_USERNAME: __token__
2242
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
23-
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
2443
run: |
25-
pixi run release
44+
pixi run build-pypi
45+
# Only publish to PyPI if token is available
46+
if [ -n "$TWINE_PASSWORD" ]; then
47+
echo "PyPI token found, publishing to PyPI..."
48+
pixi run pypi-publish
49+
else
50+
echo "No PyPI token found, skipping PyPI publishing"
51+
fi
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Tests, Package, and Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [next, qa, main]
8+
tags: ["v*"]
9+
10+
env:
11+
PKG_NAME: plot-publisher
12+
MODULE_NAME: plot_publisher
13+
14+
jobs:
15+
tests:
16+
name: Unit tests
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
21+
with:
22+
fetch-depth: 0
23+
fetch-tags: true
24+
25+
- name: Setup pixi
26+
uses: prefix-dev/[email protected]
27+
with:
28+
pixi-version: v0.50.2
29+
manifest-path: pyproject.toml
30+
31+
- name: Run unit tests
32+
run: pixi run test
33+
34+
- name: Upload coverage to codecov
35+
uses: codecov/codecov-action@v5
36+
if: github.actor != 'dependabot[bot]'
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
40+
conda-build:
41+
name: Build conda package
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v5
46+
with:
47+
fetch-depth: 0
48+
fetch-tags: true
49+
50+
- name: Setup pixi
51+
uses: prefix-dev/[email protected]
52+
with:
53+
pixi-version: v0.50.2
54+
manifest-path: pyproject.toml
55+
56+
- name: Build conda package
57+
run: |
58+
pixi run conda-build
59+
mkdir -p /tmp/local-channel/linux-64
60+
cp *.conda /tmp/local-channel/linux-64
61+
62+
- name: Verify conda package
63+
uses: neutrons/conda-verify@main
64+
with:
65+
package-name: ${{ env.PKG_NAME }}
66+
module-name: ${{ env.MODULE_NAME }}
67+
local-channel: /tmp/local-channel
68+
69+
- name: Upload conda package as artifact
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: artifact-conda-package
73+
path: ${{ env.PKG_NAME }}-*.conda
74+
75+
publish:
76+
name: Upload package to anaconda
77+
runs-on: ubuntu-latest
78+
needs: [tests, conda-build]
79+
if: startsWith(github.ref, 'refs/tags/v')
80+
steps:
81+
- name: Checkout
82+
uses: actions/checkout@v5
83+
with:
84+
fetch-depth: 0
85+
fetch-tags: true
86+
87+
- name: Setup Pixi
88+
uses: prefix-dev/[email protected]
89+
with:
90+
pixi-version: v0.50.2
91+
manifest-path: pyproject.toml
92+
93+
- name: Download conda package artifact
94+
uses: actions/download-artifact@v5
95+
with:
96+
name: artifact-conda-package
97+
98+
- name: Upload package to anaconda
99+
env:
100+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
101+
IS_RC: ${{ contains(github.ref, 'rc') }}
102+
run: |
103+
# label is main or rc depending on the tag-name
104+
CONDA_LABEL="main"
105+
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
106+
echo pushing ${{ github.ref }} with label $CONDA_LABEL
107+
pixi run anaconda upload --label $CONDA_LABEL --user neutrons ${{ env.PKG_NAME }}-*.conda

.github/workflows/update-lockfiles.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Update lockfile
2424
run: pixi update
2525
- name: Create Pull Request
26-
uses: peter-evans/create-pull-request@v6
26+
uses: peter-evans/create-pull-request@v7
2727
with:
2828
token: ${{ secrets.GITHUB_TOKEN }}
2929
commit-message: "build: update lockfile"

0 commit comments

Comments
 (0)