-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.43 KB
/
update-conda-lockfiles.yaml
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
name: update-conda-lockfiles
on:
schedule: # quarterly
- cron: "0 09 1 */3 *"
push:
paths:
- 'conda/environment.yaml'
workflow_dispatch:
permissions:
contents: write
jobs:
lock:
runs-on: ${{ matrix.config.os }}
name: lock-${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-11, slug: 'macos', shell: 'bash -l {0}'}
- {os: ubuntu-22.04, slug: 'linux', shell: 'bash -l {0}'}
- {os: windows-2022, slug: 'win', shell: 'cmd /C CALL {0}'}
defaults:
run:
shell: ${{ matrix.config.shell }}
steps:
- uses: actions/checkout@v3
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
environment-file: conda/environment.yaml
activate-environment: wflow-env
- name: Export lockfile
run: conda list --explicit --md5 > conda/environment-${{ matrix.config.slug }}.lock
- name: Commit lockfile
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
git pull origin main
git add conda/environment-${{ matrix.config.slug }}.lock
git commit --allow-empty -m "Update lockfile for ${{ matrix.config.slug }}"
git push origin main