-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (75 loc) · 2.43 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
name: Release
on:
release:
types: [published]
workflow_dispatch:
defaults:
run:
shell: bash -l {0} # required for conda env
jobs:
build_conda:
name: Conda build
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0 # history required so cmake can determine version
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: build-env
create-args: >-
conda-build
boa
- run: conda mambabuild --channel conda-forge --channel scipp --no-anaconda-upload --override-channels --output-folder conda/package conda
- uses: actions/upload-artifact@v4
with:
name: conda-package-noarch
path: conda/package/noarch/*.tar.bz2
build_wheels:
name: Wheels
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # history required so setuptools_scm can determine version
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/wheels.txt
- name: Build wheels
run: python -m build
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
upload_pypi:
name: Deploy PyPI
needs: [build_wheels, build_conda]
runs-on: 'ubuntu-latest'
environment: release
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
- uses: pypa/gh-action-pypi-publish@v1.8.14
upload_conda:
name: Deploy Conda
needs: [build_wheels, build_conda]
runs-on: 'ubuntu-latest'
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: upload-env
# frozen python due to breaking removal of 'imp' in 3.12
create-args: >-
anaconda-client
python=3.11
- run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-noarch/*.tar.bz2)