From e04b6e17edc3fb12e3965eaefff35df1cd9bc70a Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Thu, 12 Dec 2024 19:26:54 +1000 Subject: [PATCH 1/2] Handle branch refs in auto-build script --- .github/workflows/build.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) 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 }} From 5813502a8b79d4fe9fef40d322141e4a41ab9c4f Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Thu, 12 Dec 2024 19:33:39 +1000 Subject: [PATCH 2/2] Fix CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fc374440..f3790e427 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,7 @@ jobs: - name: Calc Name (hash) if: github.event_name != 'create' run: | - pyp "f'ARTI_NAME=beemod2_dev{'${{ github.sha }}'[:8]}_packages" >> "$GITHUB_ENV" + pyp "f'ARTI_NAME=beemod2_dev{'${{ github.sha }}'[:8]}_packages'" >> "$GITHUB_ENV" echo "RETENTION=8" >> "$GITHUB_ENV" - name: Packages upload