diff --git a/.github/workflows/mswn.yml b/.github/workflows/mswn.yml index 274f17b..e13974d 100644 --- a/.github/workflows/mswn.yml +++ b/.github/workflows/mswn.yml @@ -26,7 +26,9 @@ jobs: run: python3 -m poetry install - name: Build the project binary for Expedite Bridge - run: pyinstaller expedite/client/bridge/main.py --clean --onefile --name ed-bridge-$("${{ github.sha }}".SubString(0, 8)) --windowed --icon assets/icon/expedite.ico + run: pyinstaller expedite/client/bridge/main.py --clean --onefile --name ed-bridge-$("$env:GITHUB_HASH".SubString(0, 8)) --windowed --icon assets/icon/expedite.ico + env: + GITHUB_HASH: ${{ github.sha }} - name: Upload the project binaries for Expedite Bridge uses: actions/upload-artifact@v4 @@ -38,7 +40,9 @@ jobs: overwrite: true - name: Build the project binary for Expedite Prompt - run: pyinstaller expedite/client/prompt/main.py --clean --onefile --name ed-prompt-$("${{ github.sha }}".SubString(0, 8)) --icon assets/icon/expedite.ico + run: pyinstaller expedite/client/prompt/main.py --clean --onefile --name ed-prompt-$("$env:GITHUB_HASH".SubString(0, 8)) --icon assets/icon/expedite.ico + env: + GITHUB_HASH: ${{ github.sha }} - name: Upload the project binaries for Expedite Prompt uses: actions/upload-artifact@v4 @@ -50,7 +54,9 @@ jobs: overwrite: true - name: Build the project binary for Expedite Server - run: pyinstaller expedite/server/main.py --clean --onefile --name ed-server-$("${{ github.sha }}".SubString(0, 8)) --icon assets/icon/expedite.ico + run: pyinstaller expedite/server/main.py --clean --onefile --name ed-server-$("$env:GITHUB_HASH".SubString(0, 8)) --icon assets/icon/expedite.ico + env: + GITHUB_HASH: ${{ github.sha }} - name: Upload the project binaries for Expedite Server uses: actions/upload-artifact@v4 diff --git a/.github/workflows/wipe.yml b/.github/workflows/wipe.yml new file mode 100644 index 0000000..0a6e9a9 --- /dev/null +++ b/.github/workflows/wipe.yml @@ -0,0 +1,24 @@ +--- +name: Manage artifacts to retain four recent artifacts +on: [push] +jobs: + ci-wipe: + runs-on: ubuntu-latest + steps: + - name: Manage artifacts to retain four recent artifacts + run: | + KEEP_QANT=4 + ARTIFACT_UNIT=$(gh api repos/gridhead/expedite/actions/artifacts --paginate --jq '.artifacts | sort_by(.created_at) | .[].id') + ARTIFACT_LIST=($ARTIFACT_UNIT) + WIPE_QANT=$((${#ARTIFACT_LIST[@]} - $KEEP_QANT)) + if [ $WIPE_QANT -gt 0 ]; then + for item in $(seq 0 $(($WIPE_QANT - 1))); do + ARTIFACT_ID=${ARTIFACT_LIST[$item]} + echo "Deleting artifact ID $ARTIFACT_ID..." + gh api repos/gridhead/expedite/actions/artifacts/$ARTIFACT_ID -X DELETE + done + else + echo "No artifacts available." + fi + env: + GITHUB_TOKEN: ${{ secrets.GHBTOKEN }}