Repository navigation
135 lines (109 loc) · 3.89 KB
/
Copy pathbuild_upload_test.yaml
File metadata and controls
135 lines (109 loc) · 3.89 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: build, upload and lazy test
on:
push:
pull_request:
release:
types: [edited, published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Windows2019 & VS 2019 supports 10.1+
- os: ubuntu-18.04
os_base: ubuntu
shell: bash -l {0}
- os: macos-10.15
os_base: macos
shell: bash -l {0}
- os: windows-2019
os_base: windows
shell: powershell
defaults:
run:
shell: ${{ matrix.shell}}
env:
FILENAMES: temp-filenames.txt
ANACONDA_LABEL: dev
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.7
- name: Install conda build libraries
run: |
conda install conda-build conda-verify anaconda-client
- name: Choose Mac OS SDK
if: ${{ matrix.os_base == 'macos'}}
run: sudo xcode-select --switch /Applications/Xcode_11.5.app/Contents/Developer
- name: Build SplinePSF (UNIX)
if: ${{ matrix.os_base == 'ubuntu' || matrix.os_base == 'macos'}}
run: |
cd ./dist_tools/conda
conda-build -c conda-forge spline
conda-build -c conda-forge spline --output > $FILENAMES
- name: Build SplinePSF (Windows)
if: ${{ matrix.os_base == 'windows' }}
run: |
Set-Location -Path .\dist_tools\conda
conda-build -c conda-forge spline
conda-build -c conda-forge spline --output > $Env:FILENAMES
- name: Change anaconda label on release
if: github.event.release
run: |
echo "ANACONDA_LABEL=main" >> $GITHUB_ENV
- name: Change anaconda label on prerelease
if: "github.event.release.prerelease"
run: |
echo "ANACONDA_LABEL=pre" >> $GITHUB_ENV
- name: Upload to Anaconda Cloud (UNIX)
if: ${{ (matrix.os_base == 'ubuntu' || matrix.os_base == 'macos') && ( github.event.release || github.ref == 'refs/heads/master' )}}
env:
ANACONDA_TOKEN: ${{ secrets.TURAGALAB_ANACONDA_TOKEN }}
run: |
cd ./dist_tools/conda
while read NAME; do
anaconda -t $ANACONDA_TOKEN upload -l ${{ env.ANACONDA_LABEL }} --force -u turagalab $NAME
done < $FILENAMES
# - name: Upload to Anaconda Cloud (Windows)
# if: ${{ matrix.os_base == 'windows' && (github.event.release || github.ref == 'refs/heads/master' )}}
# env:
# ANACONDA_TOKEN: ${{ secrets.TURAGALAB_ANACONDA_TOKEN }}
# shell: powershell
# run: |
# Set-Location -Path .\dist_tools\conda
# foreach($PATH in Get-Content -path $Env:FILENAMES) {
# anaconda -t $Env:ANACONDA_TOKEN upload -l ${{ env.ANACONDA_LABEL }} --force -u turagalab $PATH
# }
build-linux-pip:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
environment-file: python/environment.yml
python-version: 3.7
auto-activate-base: false
activate-environment: spline_dev
- name: Build SplinePSF (pip)
id: pip-build
shell: bash -l {0}
run: |
cd ./python
pip install wheel
python setup.py bdist_wheel
WHEEL=$(ls dist)
echo "::set-output name=wheel_filename::$WHEEL"
- name: Upload to GitHub release
if: github.event.release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./python/dist/${{ steps.pip-build.outputs.wheel_filename }}
asset_name: ${{ steps.pip-build.outputs.wheel_filename }}
asset_content_type: binary/octet-stream