Omit artifact name to download all #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update lockfile | |
on: | |
workflow_dispatch: | |
push: | |
schedule: | |
# At 06:12 UTC on Monday | |
- cron: 12 6 * * MON | |
jobs: | |
conda-lock: | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
defaults: | |
run: | |
# Ensure the environment is activated | |
# <https://github.com/mamba-org/setup-micromamba#about-login-shells> | |
shell: bash -l {0} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: conda/environment-conda-locker.yaml | |
environment-name: conda-lock-env | |
cache-environment: true | |
- name: Run conda-lock | |
run: | | |
conda-lock lock --mamba \ | |
--extras test \ | |
--filter-extras \ | |
--file conda/environment-test-${{ matrix.python-version }}.yaml \ | |
--lockfile conda/conda-lock-${{ matrix.python-version }}.yaml | |
- name: Upload lockfile | |
uses: actions/upload-artifact@v2 | |
with: | |
name: conda-lock-${{ matrix.python-version }}.yaml | |
path: conda/conda-lock-${{ matrix.python-version }}.yaml | |
open-pr: | |
needs: conda-lock | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Download all lockfiles | |
uses: actions/download-artifact@v2 | |
with: | |
path: conda | |
- name: Print diff | |
run: | | |
git diff | |
- name: Open a pull request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
# This PAT should have read-write permissions for "Pull Requests" | |
# and read-write permissions for "Contents". | |
token: ${{ secrets.GH_PAT_FOR_PR }} | |
commit-message: Relock dependencies | |
title: Relock dependencies | |
body: > | |
This pull request relocks the dependencies with conda-lock. | |
It was created automatically with the GitHub Action | |
[update-lockfile.yml](.github/workflows/update-lockfile.yml). | |
branch: relock-deps | |
labels: conda-lock | |
delete-branch: true | |
committer: update-lockfile.yml <[email protected]> | |
author: update-lockfile.yml <[email protected]> |