Skip to content

Commit

Permalink
ci: name build artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Apr 25, 2024
1 parent 6474dfa commit b7398a6
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Upload build archive for test runners
uses: actions/upload-artifact@v4
with:
name: build-artifact
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions

phpunit:
Expand All @@ -45,7 +45,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
Expand All @@ -119,7 +119,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
Expand All @@ -143,7 +143,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact
name: build-artifact-${{ matrix.php }}
path: /tmp/github-actions

- name: Extract build archive
Expand All @@ -156,17 +156,18 @@ jobs:
path: src/
standard: phpcs.xml

remove_old_artifacts:
runs-on: ubuntu-latest

steps:
- name: Remove old artifacts for prior workflow runs on this repository
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name == \"build-artifact\") | .id" > artifact-id-list.txt
while read id
do
echo -n "Deleting artifact ID $id ... "
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
done <artifact-id-list.txt
# TODO: Figure this one out:
# remove_old_artifacts:
# runs-on: ubuntu-latest
#
# steps:
# - name: Remove old artifacts for prior workflow runs on this repository
# env:
# GH_TOKEN: ${{ github.token }}
# run: |
# gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name == \"build-artifact\") | .id" > artifact-id-list.txt
# while read id
# do
# echo -n "Deleting artifact ID $id ... "
# gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
# done <artifact-id-list.txt

0 comments on commit b7398a6

Please sign in to comment.