Skip to content

Merge pull request #6 from arup-group/add-pcst-fast #83

Merge pull request #6 from arup-group/add-pcst-fast

Merge pull request #6 from arup-group/add-pcst-fast #83

Workflow file for this run

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 }}