-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (62 loc) · 1.91 KB
/
conda-build.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
name: Build Package
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
find-out-changes:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-output.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
dir_names: true
dir_names_max_depth: 1
json: false
quotepath: false
files: "**/meta.yaml"
files_ignore: .github/**/*
- name: 'Set output in the matrix format'
id: set-output
if: steps.changed-files.outputs.all_changed_files != ''
run: |
STR=""
for FILE in ${{ steps.changed-files.outputs.all_changed_files }}
do
VERSION=$(grep -o 'version = \"[a-zA-Z0-9\.]*\"' $FILE/meta.yaml | cut -d \" -f 2)
STR+="{\"dir\":\"$FILE\", \"version\":\"v$VERSION\"},"
done
MATRIX="{\"include\": [${STR%?}]}"
echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
conda-build:
needs: [find-out-changes]
if: needs.find-out-changes.outputs.matrix != ''
strategy:
matrix: ${{ fromJson(needs.find-out-changes.outputs.matrix) }}
uses: arup-group/actions-city-modelling-lab/.github/workflows/conda-build.yml@main
secrets:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
with:
package_name: ${{ matrix.dir }}
recipe_dir: ${{ matrix.dir }}
version: ${{ matrix.version }}
conda-upload:
needs: [find-out-changes, conda-build]
if: github.ref == 'refs/heads/main'
strategy:
matrix: ${{ fromJson(needs.find-out-changes.outputs.matrix) }}
uses: arup-group/actions-city-modelling-lab/.github/workflows/conda-upload.yml@main
secrets:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
with:
package_name: ${{ matrix.dir }}
version: ${{ matrix.version }}