@@ -19,38 +19,16 @@ defaults:
1919 shell : bash
2020
2121jobs :
22- init :
23- runs-on : ubuntu-22.04
24- steps :
25- - uses : actions/checkout@v4
26- - run : |
27- mkdir dist && touch dist/.placeholder
28- - name : Keep artifact
29- id : keep-artifact
30- run : python -c "print('DAYS=' + str(5 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
31- - uses : actions/upload-artifact@v3
32- with :
33- name : ${{ inputs.artifact-name }}
34- path : dist
35- retention-days : ${{ steps.keep-artifact.outputs.DAYS }}
36- include-hidden-files : true
37-
3822 build-packages :
39- needs : init
4023 runs-on : ubuntu-22.04
4124 strategy :
42- max-parallel : 1 # run sequential to prevent download/upload collisions
4325 matrix :
4426 pkg-name : ${{ fromJSON(inputs.pkg-names) }}
4527 steps :
4628 - uses : actions/checkout@v4
47- - uses : actions/download-artifact@v3
48- with :
49- name : ${{ inputs.artifact-name }}
50- path : pypi
5129 - uses : actions/setup-python@v5
5230 with :
53- python-version : 3.9
31+ python-version : " 3.x "
5432
5533 - run : python -c "print('NB_DIRS=' + str(2 if '${{ matrix.pkg-name }}' == 'pytorch' else 1))" >> $GITHUB_ENV
5634 - name : Build & check package
@@ -60,11 +38,33 @@ jobs:
6038 nb-dirs : ${{ env.NB_DIRS }}
6139
6240 - run : |
63- mkdir pypi/${{ matrix.pkg-name }}
41+ mkdir -p pypi/${{ matrix.pkg-name }}
6442 cp dist/* pypi/${{ matrix.pkg-name }}/
6543
66- - uses : actions/upload-artifact@v3
44+ - uses : actions/upload-artifact@v4
45+ with :
46+ name : ${{ inputs.artifact-name }}-${{ matrix.pkg-name }}
47+ path : pypi
48+ retention-days : 1
49+
50+ merge-artifacts :
51+ needs : build-packages
52+ runs-on : ubuntu-22.04
53+ steps :
54+ - uses : actions/download-artifact@v4
55+ with : # download all build artifacts
56+ pattern : ${{ inputs.artifact-name }}-*
57+ merge-multiple : true
58+ path : pypi
59+ - run : |
60+ sudo apt-get install -y tree
61+ tree pypi
62+
63+ - name : Keep artifact
64+ run : python -c "print('DAYS=' + str(5 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_ENV
65+ - uses : actions/upload-artifact@v4
6766 with :
6867 name : ${{ inputs.artifact-name }}
6968 path : pypi
70- include-hidden-files : true
69+ retention-days : ${{ env.DAYS }}
70+ if-no-files-found : error
0 commit comments