diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c6f98e76..9fc374440 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,24 +48,28 @@ jobs: cache-dependency-path: 'requirements.txt' - name: Install dependencies - run: python -m pip install -r requirements.txt + run: python -m pip install -r requirements.txt pypyp - name: Build Packages run: python compile_packages.py --confirm --overwrite --zip "" "packages/" - - name: Packages upload (tag) - uses: actions/upload-artifact@v4 + - name: Calc Name (tag) if: github.event_name == 'create' - with: - name: beemod2_${{ github.event.ref }}_packages - path: ./zips/ - if-no-files-found: error + # Strip folders from ref names, / isn't valid in a filename. + run: | + pyp "f'ARTI_NAME=beemod2_{re.sub('[^a-zA-Z0-9]+', '', Path('${{ github.event.ref }}').stem}_packages')" >> "$GITHUB_ENV" + echo "RETENTION=30" >> "$GITHUB_ENV" - - name: Packages upload (hash) - uses: actions/upload-artifact@v4 + - name: Calc Name (hash) if: github.event_name != 'create' + run: | + pyp "f'ARTI_NAME=beemod2_dev{'${{ github.sha }}'[:8]}_packages" >> "$GITHUB_ENV" + echo "RETENTION=8" >> "$GITHUB_ENV" + + - name: Packages upload + uses: actions/upload-artifact@v4 with: - name: beemod2_${{ github.sha }}_packages + name: ${{ env.ARTI_NAME }} path: ./zips/ if-no-files-found: error - retention-days: 8 + retention-days: ${{ env.RETENTION }}