-
Notifications
You must be signed in to change notification settings - Fork 5
107 lines (96 loc) · 3.46 KB
/
ci-distro-trial_2-build-metapackage.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
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
on:
workflow_call:
inputs:
seed-environment-key:
required: true
type: string
solved-environment-key:
required: true
type: string
rebuilt-channel-key:
required: true
type: string
patched-channel-key:
required: true
type: string
distro-name:
required: true
type: string
outputs:
distro-version:
value: ${{ jobs.setup-version.outputs.version }}
env:
patched_channel_path: './patched-channel'
rebuilt_channel_path: './rebuilt-channel'
seed_environment_path: './seed-env'
environment_prefix: './test-env/'
jobs:
setup-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.create-version.outputs.version }}
steps:
- id: create-version
shell: bash
run: |
echo version=$(
python -c "import datetime; print(datetime.datetime.utcnow().strftime('%Y.%m.%d.%H.%M.%S'))"
) >> $GITHUB_OUTPUT
build-metapackage:
needs: [setup-version]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12]
runs-on: ${{ matrix.os }}
steps:
- uses: qiime2/action-library-packaging/clean-disk@beta
if: ${{ runner.os == 'Linux' }}
name: "Clean disk on linux"
- name: fetch seed env
uses: actions/download-artifact@v3
with:
name: ${{ inputs.seed-environment-key }}
path: ${{ env.seed_environment_path }}
- uses: actions/download-artifact@v3
name: 'Fetch base channel with patches'
with:
name: ${{ inputs.patched-channel-key }}
path: ${{ env.patched_channel_path }}
- name: fetch rebuilt channel
uses: actions/download-artifact@v3
with:
name: ${{ inputs.rebuilt-channel-key }}
path: ${{ env.rebuilt_channel_path }}
- uses: qiime2/action-library-packaging/environment@beta
id: build-env
name: "Set up build env"
- uses: qiime2/action-library-packaging/build-metapackage@beta
name: "Build metapackage"
id: build-meta
with:
conda-activate: ${{ steps.build-env.outputs.conda-activate }}
channels: '["${{ env.rebuilt_channel_path }}", "${{ env.patched_channel_path }}"]'
metapackage-name: ${{ inputs.distro-name }}
metapackage-version: ${{ needs.setup-version.outputs.version }}
seed-environment: '${{ env.seed_environment_path }}/seed-environment-conda.yml'
output-channel: ${{ env.rebuilt_channel_path }}
- name: Install metapackage, create env file, and cache
id: cache-env
uses: qiime2/action-library-packaging/create-env@beta
with:
conda-prefix: ${{ env.environment_prefix }}
environment-file: ${{ inputs.distro-name }}-${{ matrix.os == 'ubuntu-latest' && matrix.os || 'macos-latest' }}-conda.yml
channels: ${{ steps.build-meta.outputs.channels }}
package-name: ${{ inputs.distro-name }}
package-version: ${{ needs.setup-version.outputs.version }}
- name: upload rebuilt channel with metapackage
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.rebuilt-channel-key }}
path: ${{ env.rebuilt_channel_path }}
- name: upload environment file
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.solved-environment-key }}
path: ${{ steps.cache-env.outputs.environment-file }}