From e4fd02e6204df1a72281f1a67b0efa5015f97992 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 01:46:03 +1100 Subject: [PATCH 01/14] GitHub Actions - Optimsation for Artefacts - Fix missing downloads --- .github/workflows/build-ios.yml | 26 +++++++--------------- .github/workflows/build-macos.yml | 28 ++++++++---------------- .github/workflows/build-msys2.yml | 6 +---- .github/workflows/build-tvos.yml | 28 ++++++++---------------- .github/workflows/build-vs2019-x64.yml | 8 ++----- .github/workflows/build-vs2022-arm64.yml | 8 ++----- .github/workflows/build-vs2022-x64.yml | 8 ++----- 7 files changed, 33 insertions(+), 79 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 298148fed..f542000db 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -34,16 +34,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - uses: actions/checkout@v4 - name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }} @@ -57,14 +53,10 @@ jobs: script: | const fs = require('fs'); const path = require('path'); - // https://api.github.com/repos/openframeworks/apothecary/actions/artifacts?per_page=250 - // Ensure the output directory exists const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'out'); if (!fs.existsSync(outputDir)){ fs.mkdirSync(outputDir); } - - // List all artifacts for the repository const artifacts = await github.rest.actions.listArtifactsForRepo({ owner: 'openframeworks', repo: 'apothecary', @@ -72,28 +64,26 @@ jobs: direction: 'desc', per_page: 150 }); - const target = process.env.TARGET; const bundle = process.env.MATRIX_BUNDLE; const release = process.env.RELEASE; const artifactName1 = `libs-${release}-${target}-1`; const artifactName2 = `libs-${release}-${target}-2`; const artifactName3 = `libs-${release}-${target}-3`; - - const artifactNamesToDownload = [artifactName1, artifactName2, artifactName3]; + const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); let count = 0; - const max=3; - + const max = 3; for (const artifact of artifacts.data.artifacts) { - if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired) { - // Download the artifact + const isBranchMatch = artifact.workflow_run.head_branch === release; + const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); + const isPullRequest = artifact.workflow_run.event === 'pull_request'; + if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: artifact.id, archive_format: 'zip', }); - const artifactPath = path.join(outputDir, `${artifact.name}.zip`); fs.writeFileSync(artifactPath, Buffer.from(download.data)); console.log(`Downloaded ${artifact.name} to ${artifactPath}`); @@ -102,7 +92,7 @@ jobs: break; } } - } + } - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' run: | @@ -189,7 +179,7 @@ jobs: BUNDLE: ${{ matrix.bundle }} - name: Update Release arm64 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index a5f666b40..fb0820fee 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -34,16 +34,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - uses: actions/checkout@v4 - name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }} @@ -57,43 +53,37 @@ jobs: script: | const fs = require('fs'); const path = require('path'); - // https://api.github.com/repos/openframeworks/apothecary/actions/artifacts?per_page=250 - // Ensure the output directory exists const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'out'); if (!fs.existsSync(outputDir)){ fs.mkdirSync(outputDir); } - - // List all artifacts for the repository const artifacts = await github.rest.actions.listArtifactsForRepo({ owner: 'openframeworks', repo: 'apothecary', sort: 'created_at', direction: 'desc', - per_page: 50 + per_page: 150 }); - const target = process.env.TARGET; const bundle = process.env.MATRIX_BUNDLE; const release = process.env.RELEASE; const artifactName1 = `libs-${release}-${target}-1`; const artifactName2 = `libs-${release}-${target}-2`; const artifactName3 = `libs-${release}-${target}-3`; - - const artifactNamesToDownload = [artifactName1, artifactName2, artifactName3]; + const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); let count = 0; - const max=3; - + const max = 3; for (const artifact of artifacts.data.artifacts) { - if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired) { - // Download the artifact + const isBranchMatch = artifact.workflow_run.head_branch === release; + const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); + const isPullRequest = artifact.workflow_run.event === 'pull_request'; + if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: artifact.id, archive_format: 'zip', }); - const artifactPath = path.join(outputDir, `${artifact.name}.zip`); fs.writeFileSync(artifactPath, Buffer.from(download.data)); console.log(`Downloaded ${artifact.name} to ${artifactPath}`); @@ -102,7 +92,7 @@ jobs: break; } } - } + } - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' run: | @@ -184,7 +174,7 @@ jobs: BUNDLE: ${{ matrix.bundle }} - name: Update Release XCFramework if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} diff --git a/.github/workflows/build-msys2.yml b/.github/workflows/build-msys2.yml index 76b75e563..5935af58d 100644 --- a/.github/workflows/build-msys2.yml +++ b/.github/workflows/build-msys2.yml @@ -59,16 +59,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - name: Clone repository uses: actions/checkout@v4 @@ -85,7 +81,7 @@ jobs: run: ls -lah out/ - name: Update Release if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index 5a05781e7..f31c62b2e 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -34,16 +34,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - uses: actions/checkout@v4 - name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }} @@ -57,43 +53,37 @@ jobs: script: | const fs = require('fs'); const path = require('path'); - // https://api.github.com/repos/openframeworks/apothecary/actions/artifacts?per_page=250 - // Ensure the output directory exists const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'out'); if (!fs.existsSync(outputDir)){ fs.mkdirSync(outputDir); } - - // List all artifacts for the repository const artifacts = await github.rest.actions.listArtifactsForRepo({ owner: 'openframeworks', repo: 'apothecary', sort: 'created_at', direction: 'desc', - per_page: 50 + per_page: 150 }); - const target = process.env.TARGET; const bundle = process.env.MATRIX_BUNDLE; const release = process.env.RELEASE; const artifactName1 = `libs-${release}-${target}-1`; const artifactName2 = `libs-${release}-${target}-2`; const artifactName3 = `libs-${release}-${target}-3`; - - const artifactNamesToDownload = [artifactName1, artifactName2, artifactName3]; + const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); let count = 0; - const max=3; - + const max = 3; for (const artifact of artifacts.data.artifacts) { - if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired) { - // Download the artifact + const isBranchMatch = artifact.workflow_run.head_branch === release; + const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); + const isPullRequest = artifact.workflow_run.event === 'pull_request'; + if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: artifact.id, archive_format: 'zip', }); - const artifactPath = path.join(outputDir, `${artifact.name}.zip`); fs.writeFileSync(artifactPath, Buffer.from(download.data)); console.log(`Downloaded ${artifact.name} to ${artifactPath}`); @@ -102,7 +92,7 @@ jobs: break; } } - } + } - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' run: | @@ -191,7 +181,7 @@ jobs: GA_CI_SECRET: ${{ secrets.CI_SECRET }} - name: Update Release XCFramework if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index f7ad3c0c9..06244abae 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -58,16 +58,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - name: 'Download artifacts' uses: actions/github-script@v7 @@ -89,7 +85,7 @@ jobs: repo: 'apothecary', sort: 'created_at', direction: 'desc', - per_page: 50 + per_page: 150 }); const target = process.env.TARGET + "-2019"; @@ -172,7 +168,7 @@ jobs: retention-days: 31 - name: Update Release x64 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index 56e98d286..62b13ce43 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -59,16 +59,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - name: 'Download artifacts' uses: actions/github-script@v7 @@ -90,7 +86,7 @@ jobs: repo: 'apothecary', sort: 'created_at', direction: 'desc', - per_page: 50 + per_page: 150 }); const target = process.env.TARGET; @@ -173,7 +169,7 @@ jobs: retention-days: 31 - name: Update Release ARM64 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index 0c41e09f9..c69ffe8b6 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -58,16 +58,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - name: 'Download artifacts' uses: actions/github-script@v7 @@ -89,7 +85,7 @@ jobs: repo: 'apothecary', sort: 'created_at', direction: 'desc', - per_page: 50 + per_page: 150 }); const target = process.env.TARGET; @@ -171,7 +167,7 @@ jobs: retention-days: 31 - name: Update Release x64 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} From 5e89242198326fe0e5cd33e0db9fc3b258e01bab Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 01:51:51 +1100 Subject: [PATCH 02/14] Actions --- .github/workflows/build-emscripten.yml | 2 +- .github/workflows/build-vs2022-arm64ec.yml | 8 ++------ .github/workflows/build-xcframework.yml | 10 +++------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index ae0e832ec..2917425ef 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -63,7 +63,7 @@ jobs: repo: 'apothecary', sort: 'created_at', direction: 'desc', - per_page: 50 + per_page: 150 }); const target = process.env.TARGET; diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index 1f13b6261..41d8a44a4 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -59,16 +59,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - name: 'Download artifacts' uses: actions/github-script@v7 @@ -90,7 +86,7 @@ jobs: repo: 'apothecary', sort: 'created_at', direction: 'desc', - per_page: 50 + per_page: 150 }); const target = process.env.TARGET; @@ -173,7 +169,7 @@ jobs: retention-days: 31 - name: Update Release ARM64EC if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} diff --git a/.github/workflows/build-xcframework.yml b/.github/workflows/build-xcframework.yml index 63f232918..0c01f7552 100644 --- a/.github/workflows/build-xcframework.yml +++ b/.github/workflows/build-xcframework.yml @@ -68,16 +68,12 @@ jobs: run: | if [[ "${{ github.ref }}" == refs/tags/* ]]; then echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=latest" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - uses: actions/checkout@v4 - name: Scripts Calc Formula @@ -204,21 +200,21 @@ jobs: GA_CI_SECRET: ${{ secrets.CI_SECRET }} - name: Update Release macOS 1 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} files: xout_1/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_1.tar.bz2 - name: Update Release macOS 2 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} files: xout_2/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_2.tar.bz2 - name: Update Release macOS 3 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.0.8 + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} From 600090b35e6559eb6f3e86670138a651bd6aa857 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 03:24:22 +1100 Subject: [PATCH 03/14] Actions YML fix --- .github/workflows/build-ios.yml | 2 +- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-tvos.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index f542000db..06c951263 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -92,7 +92,7 @@ jobs: break; } } - } + } - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' run: | diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index fb0820fee..40b9e0154 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -92,7 +92,7 @@ jobs: break; } } - } + } - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' run: | diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index f31c62b2e..c3883c08c 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -92,7 +92,7 @@ jobs: break; } } - } + } - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' run: | From 91a052dc1a61f3d219d2e74386cd0fab5cc00197 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 03:36:16 +1100 Subject: [PATCH 04/14] Actions Artefact name fix macOS --- .github/workflows/build-ios.yml | 3 ++- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-tvos.yml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 06c951263..6ef2f4492 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -67,6 +67,7 @@ jobs: const target = process.env.TARGET; const bundle = process.env.MATRIX_BUNDLE; const release = process.env.RELEASE; + const artifactName1 = `libs-${release}-${target}-1`; const artifactName2 = `libs-${release}-${target}-2`; const artifactName3 = `libs-${release}-${target}-3`; @@ -77,7 +78,7 @@ jobs: const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { + if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 40b9e0154..80aaa1778 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -77,7 +77,7 @@ jobs: const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { + if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index c3883c08c..383069deb 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -77,7 +77,7 @@ jobs: const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { + if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, From 19df7d37441b6383d91c83ab47094399395c8f21 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 03:45:15 +1100 Subject: [PATCH 05/14] Actions set format --- .github/workflows/build-ios.yml | 4 ++-- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-tvos.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 6ef2f4492..0ebe2ea76 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -71,14 +71,14 @@ jobs: const artifactName1 = `libs-${release}-${target}-1`; const artifactName2 = `libs-${release}-${target}-2`; const artifactName3 = `libs-${release}-${target}-3`; - const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); + const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); let count = 0; const max = 3; for (const artifact of artifacts.data.artifacts) { const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { + if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 80aaa1778..6040fc3ee 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -77,7 +77,7 @@ jobs: const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { + if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index 383069deb..7e7847a04 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -77,7 +77,7 @@ jobs: const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifactNamesToDownload.includes(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { + if (artifactNamesToDownload.has(artifact.name)&& !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, From 49ced7a1608638ed60cedd0739660f8aa0d08d36 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 13:34:10 +1100 Subject: [PATCH 06/14] Apothecary - Add ability for CMake to use CCache --- apothecary/apothecary | 6 ++++++ scripts/vs/install.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apothecary/apothecary b/apothecary/apothecary index 00919af11..f9a612ab4 100755 --- a/apothecary/apothecary +++ b/apothecary/apothecary @@ -196,6 +196,12 @@ WIN11_INSTALLED_SDK_2022=10.0.22621.0 WIN11_INSTALLED_SDK_2022_HEX=0x0A00586D +if [ -z "${USE_CCACHE+x}" ]; then + export CC="ccache gcc" + export CXX="ccache g++" + export CMAKE_DEFS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" +fi + # nice, detailed help message HELP="usage: apothecary [options] [] diff --git a/scripts/vs/install.sh b/scripts/vs/install.sh index b6c4bc8ae..84c086e37 100644 --- a/scripts/vs/install.sh +++ b/scripts/vs/install.sh @@ -44,4 +44,5 @@ echoDots(){ } winget install -e --id Microsoft.WindowsTerminal -winget install Ninja-build.Ninja" +winget install Ninja-build.Ninja +winget install jqlang.jq From 8a459fd40f95126b13cb53b4a61e7dd673f05f8f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 13:34:43 +1100 Subject: [PATCH 07/14] Action Artefact iOS with logs --- .github/workflows/build-ios.yml | 79 +++++++++++++++++++-------------- scripts/artifact/artifact-dl.sh | 2 +- 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 0ebe2ea76..5698a58eb 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -57,42 +57,53 @@ jobs: if (!fs.existsSync(outputDir)){ fs.mkdirSync(outputDir); } - const artifacts = await github.rest.actions.listArtifactsForRepo({ - owner: 'openframeworks', - repo: 'apothecary', - sort: 'created_at', - direction: 'desc', - per_page: 150 - }); - const target = process.env.TARGET; - const bundle = process.env.MATRIX_BUNDLE; - const release = process.env.RELEASE; - - const artifactName1 = `libs-${release}-${target}-1`; - const artifactName2 = `libs-${release}-${target}-2`; - const artifactName3 = `libs-${release}-${target}-3`; - const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); - let count = 0; - const max = 3; - for (const artifact of artifacts.data.artifacts) { - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { - const download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: artifact.id, - archive_format: 'zip', - }); - const artifactPath = path.join(outputDir, `${artifact.name}.zip`); - fs.writeFileSync(artifactPath, Buffer.from(download.data)); - console.log(`Downloaded ${artifact.name} to ${artifactPath}`); - count++; - if (count >= max) { - break; + try { + const artifacts = await github.rest.actions.listArtifactsForRepo({ + owner: 'openframeworks', + repo: 'apothecary', + sort: 'created_at', + direction: 'desc', + per_page: 150 + }); + const target = process.env.TARGET; + const bundle = process.env.MATRIX_BUNDLE; + const release = process.env.RELEASE; + console.log(`Target: ${target}, Bundle: ${bundle}, Release: ${release}`); + const artifactName1 = `libs-${release}-${target}-1`; + const artifactName2 = `libs-${release}-${target}-2`; + const artifactName3 = `libs-${release}-${target}-3`; + const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); + console.log(`Artifacts to download: ${Array.from(artifactNamesToDownload).join(', ')}`); + let count = 0; + const max = 3; + for (const artifact of artifacts.data.artifacts) { + console.log(`Checking artifact: ${artifact.name} (Expired: ${artifact.expired})`); + const isBranchMatch = artifact.workflow_run.head_branch === release; + const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); + const isPullRequest = artifact.workflow_run.event === 'pull_request'; + console.log(`Branch Match: ${isBranchMatch}, Tag Match: ${isTagMatch}, Pull Request: ${isPullRequest}`); + if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { + const download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); + const artifactPath = path.join(outputDir, `${artifact.name}.zip`); + fs.writeFileSync(artifactPath, Buffer.from(download.data)); + console.log(`Downloaded ${artifact.name} to ${artifactPath}`); + count++; + if (count >= max) { + console.log("Reached maximum artifact download count."); + break; + } } } + else { + console.log(`Skipping artifact: ${artifact.name} - Conditions not met.`); + } + } catch (error) { + console.error("An error occurred:", error); } - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' diff --git a/scripts/artifact/artifact-dl.sh b/scripts/artifact/artifact-dl.sh index c664de1b6..28b6fcdfd 100755 --- a/scripts/artifact/artifact-dl.sh +++ b/scripts/artifact/artifact-dl.sh @@ -11,7 +11,7 @@ fi OWNER="openframeworks" REPO="apothecary" -PER_PAGE=9 +PER_PAGE=150 OUTPUT_DIR="./out" TOKEN="$1" From e719df899376703d5b3ae46d1bf8194caec8bd77 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 13:49:44 +1100 Subject: [PATCH 08/14] Artefact iOS Logs --- .github/workflows/build-ios.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 5698a58eb..7534fecfe 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -54,10 +54,14 @@ jobs: const fs = require('fs'); const path = require('path'); const outputDir = path.join(process.env.GITHUB_WORKSPACE, 'out'); - if (!fs.existsSync(outputDir)){ + + // Ensure output directory exists + if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir); } + try { + console.log("Fetching artifacts..."); const artifacts = await github.rest.actions.listArtifactsForRepo({ owner: 'openframeworks', repo: 'apothecary', @@ -65,23 +69,32 @@ jobs: direction: 'desc', per_page: 150 }); + const target = process.env.TARGET; const bundle = process.env.MATRIX_BUNDLE; const release = process.env.RELEASE; + console.log(`Target: ${target}, Bundle: ${bundle}, Release: ${release}`); + const artifactName1 = `libs-${release}-${target}-1`; const artifactName2 = `libs-${release}-${target}-2`; const artifactName3 = `libs-${release}-${target}-3`; - const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); - console.log(`Artifacts to download: ${Array.from(artifactNamesToDownload).join(', ')}`); + const artifactNamesToDownload = new Set([artifactName1, artifactName2, artifactName3]); + + console.log(`Artifacts to download: ${Array.from(artifactNamesToDownload).join(', ')}`); + let count = 0; const max = 3; + for (const artifact of artifacts.data.artifacts) { console.log(`Checking artifact: ${artifact.name} (Expired: ${artifact.expired})`); + const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); const isPullRequest = artifact.workflow_run.event === 'pull_request'; + console.log(`Branch Match: ${isBranchMatch}, Tag Match: ${isTagMatch}, Pull Request: ${isPullRequest}`); + if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, @@ -89,22 +102,24 @@ jobs: artifact_id: artifact.id, archive_format: 'zip', }); + const artifactPath = path.join(outputDir, `${artifact.name}.zip`); fs.writeFileSync(artifactPath, Buffer.from(download.data)); console.log(`Downloaded ${artifact.name} to ${artifactPath}`); count++; + if (count >= max) { console.log("Reached maximum artifact download count."); break; } + } else { + console.log(`Skipping artifact: ${artifact.name} - Conditions not met.`); } } - else { - console.log(`Skipping artifact: ${artifact.name} - Conditions not met.`); - } } catch (error) { - console.error("An error occurred:", error); + console.error("An error occurred:", error); } + - name: Extract Artifacts to /out if: env.USE_ARTIFACT == 'true' run: | From 643f25929a2f31ac20bb11494cb66804056f11ba Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 15 Nov 2024 14:20:49 +1100 Subject: [PATCH 09/14] Actions yo --- .github/workflows/build-ios.yml | 8 ++++---- apothecary/apothecary | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 7534fecfe..0d8d3ed81 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -19,7 +19,7 @@ env: USE_ARTIFACT: true jobs: - build-macos-platforms: + build-for-ios-platform: runs-on: macos-14 strategy: matrix: @@ -91,11 +91,11 @@ jobs: const isBranchMatch = artifact.workflow_run.head_branch === release; const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - const isPullRequest = artifact.workflow_run.event === 'pull_request'; + const isPRTargetBranchMatch = artifact.workflow_run.event === 'pull_request' && artifact.workflow_run.base_branch === release; - console.log(`Branch Match: ${isBranchMatch}, Tag Match: ${isTagMatch}, Pull Request: ${isPullRequest}`); + console.log(`Branch Match: ${isBranchMatch}, PR Target Branch Match: ${isPRTargetBranchMatch}, Tag Match: ${isTagMatch}`); - if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { + if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch || isPRTargetBranchMatch)) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/apothecary/apothecary b/apothecary/apothecary index f9a612ab4..a25add78e 100755 --- a/apothecary/apothecary +++ b/apothecary/apothecary @@ -196,11 +196,11 @@ WIN11_INSTALLED_SDK_2022=10.0.22621.0 WIN11_INSTALLED_SDK_2022_HEX=0x0A00586D -if [ -z "${USE_CCACHE+x}" ]; then - export CC="ccache gcc" - export CXX="ccache g++" - export CMAKE_DEFS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" -fi +# if [ -z "${USE_CCACHE+x}" ]; then +# export CC="ccache gcc" +# export CXX="ccache g++" +# export CMAKE_DEFS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" +# fi # nice, detailed help message From 750ed1afc6bc0a3c65a506e8739e66d21dbda95e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Mon, 18 Nov 2024 22:03:13 +1100 Subject: [PATCH 10/14] GitHub Actions - Download fix --- .github/workflows/build-emscripten.yml | 4 ++-- .github/workflows/build-ios.yml | 9 ++------- .github/workflows/build-macos.yml | 7 +++---- .github/workflows/build-tvos.yml | 6 ++---- .github/workflows/build-vs2019-x64.yml | 8 ++------ .github/workflows/build-vs2022-arm64.yml | 8 ++------ .github/workflows/build-vs2022-arm64ec.yml | 8 ++------ .github/workflows/build-vs2022-x64.yml | 7 ++----- 8 files changed, 17 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index 2917425ef..fe91a9c10 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -76,8 +76,8 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - if (artifact.name.startsWith(artifactName) && !artifact.expired) { - // Download the artifact + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 0d8d3ed81..24c7c266c 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -89,13 +89,8 @@ jobs: for (const artifact of artifacts.data.artifacts) { console.log(`Checking artifact: ${artifact.name} (Expired: ${artifact.expired})`); - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - const isPRTargetBranchMatch = artifact.workflow_run.event === 'pull_request' && artifact.workflow_run.base_branch === release; - - console.log(`Branch Match: ${isBranchMatch}, PR Target Branch Match: ${isPRTargetBranchMatch}, Tag Match: ${isTagMatch}`); - - if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch || isPRTargetBranchMatch)) { + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 6040fc3ee..5b29b3942 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -57,6 +57,7 @@ jobs: if (!fs.existsSync(outputDir)){ fs.mkdirSync(outputDir); } + // https://api.github.com/repos/openframeworks/apothecary/actions/artifacts?per_page=250 const artifacts = await github.rest.actions.listArtifactsForRepo({ owner: 'openframeworks', repo: 'apothecary', @@ -74,10 +75,8 @@ jobs: let count = 0; const max = 3; for (const artifact of artifacts.data.artifacts) { - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifactNamesToDownload.has(artifact.name) && !artifact.expired && (isBranchMatch || isTagMatch)) { + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index 7e7847a04..a86a39797 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -74,10 +74,8 @@ jobs: let count = 0; const max = 3; for (const artifact of artifacts.data.artifacts) { - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - const isPullRequest = artifact.workflow_run.event === 'pull_request'; - if (artifactNamesToDownload.has(artifact.name)&& !artifact.expired && (isBranchMatch || isTagMatch)) { + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index 06244abae..9884e5cb5 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -98,18 +98,14 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { - - // Download the artifact + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: artifact.id, archive_format: 'zip', }); - const artifactPath = path.join(outputDir, `${artifact.name}.zip`); fs.writeFileSync(artifactPath, Buffer.from(download.data)); console.log(`Downloaded ${artifact.name} to ${artifactPath}`); diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index 62b13ce43..66971748c 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -99,12 +99,8 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - - if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { - // Download the artifact + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index 41d8a44a4..83327d8b2 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -99,12 +99,8 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - - if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { - - // Download the artifact + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index c69ffe8b6..f0e125dee 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -98,11 +98,8 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isBranchMatch = artifact.workflow_run.head_branch === release; - const isTagMatch = artifact.workflow_run.event === 'release' && artifact.name.includes(`libs-${release}`); - if (artifact.name === artifactName && !artifact.expired && (isBranchMatch || isTagMatch)) { - - // Download the artifact + const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, From b46a88be727fbdc7a50dc28630183230da145219 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Mon, 18 Nov 2024 23:43:36 +1100 Subject: [PATCH 11/14] Fix downloads Github --- .github/workflows/build-emscripten.yml | 2 +- .github/workflows/build-ios.yml | 2 +- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-tvos.yml | 2 +- .github/workflows/build-vs2019-x64.yml | 2 +- .github/workflows/build-vs2022-arm64.yml | 2 +- .github/workflows/build-vs2022-arm64ec.yml | 2 +- .github/workflows/build-vs2022-x64.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index fe91a9c10..814b358fd 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -76,7 +76,7 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 24c7c266c..67fa8634c 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -89,7 +89,7 @@ jobs: for (const artifact of artifacts.data.artifacts) { console.log(`Checking artifact: ${artifact.name} (Expired: ${artifact.expired})`); - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 5b29b3942..baf603cdd 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -75,7 +75,7 @@ jobs: let count = 0; const max = 3; for (const artifact of artifacts.data.artifacts) { - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index a86a39797..e11235011 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -74,7 +74,7 @@ jobs: let count = 0; const max = 3; for (const artifact of artifacts.data.artifacts) { - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index 9884e5cb5..f579d3f30 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -98,7 +98,7 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index 66971748c..3a60c722e 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -99,7 +99,7 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index 83327d8b2..6e78caa0c 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -99,7 +99,7 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index f0e125dee..8b8437afc 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -98,7 +98,7 @@ jobs: const max = 1; for (const artifact of artifacts.data.artifacts) { - const isArtifactMatch = artifact.name.includes(`libs-${release}`) && !artifact.expired; + const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired; if (isArtifactMatch) { const download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, From 1b875674447a3de49e8ab4e658ebf36e898346bd Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Mon, 18 Nov 2024 23:55:31 +1100 Subject: [PATCH 12/14] GLEW stopped working fix --- apothecary/formulas/glew.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apothecary/formulas/glew.sh b/apothecary/formulas/glew.sh index 7ef47d84b..a021dc00b 100644 --- a/apothecary/formulas/glew.sh +++ b/apothecary/formulas/glew.sh @@ -51,7 +51,7 @@ function build() { rm -f CMakeCache.txt *.a *.o cmake ../build/cmake \ -DCMAKE_C_STANDARD=${C_STANDARD} \ - -DCMAKE_C_STANDARD=${CPP_STANDARD} \ + -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1" \ @@ -88,12 +88,10 @@ function build() { cmake ../build/cmake ${DEFS} \ -DCMAKE_C_STANDARD=${C_STANDARD} \ - -DCMAKE_C_STANDARD=${CPP_STANDARD} \ + -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ - -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1" \ - -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1" \ - -DCMAKE_CXX_FLAGS_RELEASE="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ - -DCMAKE_C_FLAGS_RELEASE="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ + -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ + -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ -DCMAKE_CXX_EXTENSIONS=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_BUILD_TYPE=Release \ From 384147b8ab996e7c7b5cabcd34879766ec722d0e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 19 Nov 2024 01:36:00 +1100 Subject: [PATCH 13/14] VS Glew Fix --- apothecary/formulas/glew.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apothecary/formulas/glew.sh b/apothecary/formulas/glew.sh index a021dc00b..35606ec28 100644 --- a/apothecary/formulas/glew.sh +++ b/apothecary/formulas/glew.sh @@ -86,10 +86,14 @@ function build() { rm -f CMakeCache.txt *.lib *.o DEFS="-DLIBRARY_SUFFIX=${ARCH}" + env CXXFLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${CALLING_CONVENTION}" + env CFLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${CALLING_CONVENTION}" cmake ../build/cmake ${DEFS} \ -DCMAKE_C_STANDARD=${C_STANDARD} \ -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -UCMAKE_CXX_FLAGS \ + -UCMAKE_C_FLAGS \ -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ -DCMAKE_CXX_EXTENSIONS=OFF \ @@ -102,6 +106,7 @@ function build() { -DCMAKE_INSTALL_PREFIX=Release \ -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ -DCMAKE_INSTALL_INCLUDEDIR=include \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ ${CMAKE_WIN_SDK} \ -A "${PLATFORM}" \ -G "${GENERATOR_NAME}" From 9356cacae195dd26bd3fddd4a3284ef68437bae1 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 19 Nov 2024 02:42:47 +1100 Subject: [PATCH 14/14] Apothecary vs arm64 -d --- apothecary/apothecary | 5 ++++- apothecary/formulas/glew.sh | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apothecary/apothecary b/apothecary/apothecary index a25add78e..6893cd3a2 100755 --- a/apothecary/apothecary +++ b/apothecary/apothecary @@ -623,7 +623,7 @@ if [ "$TYPE" = "vs" ]; then if [ $ARCH == "arm64ec" ]; then export VS_C_FLAGS="/Gy /GL- /guard:cf" else - export VS_C_FLAGS="/GL-" + export VS_C_FLAGS="/GL-" fi export FLAGS_RELEASE="${MT_TYPE} ${CALLING_CONVENTION} /O2 /DNDEBUG -DUNICODE -D_UNICODE" export FLAGS_DEBUG="${MT_TYPE}d ${CALLING_CONVENTION} /Od /DDEBUG -DUNICODE -D_UNICODE" @@ -748,6 +748,9 @@ if [ "$TYPE" = "vs" ]; then export CMAKE_WIN_SDK_HEX=${WIN10_INSTALLED_SDK_2022_HEX} fi + if [ $ARCH == "arm64ec" ] || [ $ARCH == "arm64" ]; then + export CMAKE_WIN_SDK="${CMAKE_WIN_SDK} -D_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1" + fi if [ $VS_COMPILER == "LLVM" ]; then export CMAKE_WIN_SDK="${CMAKE_WIN_SDK} -DCMAKE_CXX_COMPILER=${VS_BIN_PATH}/clang++ -DCMAKE_C_COMPILER=${VS_BIN_PATH}/clang -T ClangCL -DLLVM_ENABLE_RUNTIMES=libcxx -DLIBCXX_ENABLE_SHARED=NO -DLIBCXX_ENABLE_STATIC=YES" fi diff --git a/apothecary/formulas/glew.sh b/apothecary/formulas/glew.sh index 35606ec28..89cfdddd9 100644 --- a/apothecary/formulas/glew.sh +++ b/apothecary/formulas/glew.sh @@ -160,7 +160,6 @@ function clean() { if [ "$TYPE" == "vs" ] ; then rm -rf build_${TYPE}_${ARCH} - rm -rf $1/lib/$TYPE/* else make clean rm -f *.a *.lib