mirror of
https://github.com/ivabus/pantry
synced 2024-11-30 04:05:06 +03:00
fix bottle.yml:cleanup
This commit is contained in:
parent
5e5016d20d
commit
5e50f9ead7
2 changed files with 12 additions and 4 deletions
14
.github/workflows/bottle.yml
vendored
14
.github/workflows/bottle.yml
vendored
|
@ -28,6 +28,7 @@ jobs:
|
|||
outputs:
|
||||
srcs: ${{ env.srcs }}
|
||||
built: ${{ env.built }}
|
||||
pr: ${{ env.PR }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -57,7 +58,7 @@ jobs:
|
|||
name: ${{ matrix.platform.name }}
|
||||
path: tea.xyz/var/pantry
|
||||
|
||||
- run: scripts/fetch-pr-artifacts.ts ${{ github.repository }} ${{ github.sha }} ${{ matrix.platform.name }}
|
||||
- run: scripts/fetch-pr-artifacts.ts ${{ github.repository }} ${{ github.sha }} ${{ matrix.platform.name }} >>$GITHUB_ENV
|
||||
if: ${{ !inputs.new-version }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{github.token}}
|
||||
|
@ -231,8 +232,8 @@ jobs:
|
|||
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [upload]
|
||||
if: startsWith(github.ref, 'refs/pull/') && startsWith(github.repository, 'teaxyz/pantry.')
|
||||
needs: [bottle, upload]
|
||||
if: ${{ !inputs.new-version }}
|
||||
steps:
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
|
@ -242,8 +243,13 @@ jobs:
|
|||
aws-region: us-east-1
|
||||
- run: |
|
||||
REPO=$(echo ${{github.repository}} | sed -e 's_teaxyz/__')
|
||||
PR=$(echo ${{github.ref}} | sed -e 's_refs/pull/\(.*\)/merge_\1_')
|
||||
|
||||
if test -z "$PR"; then
|
||||
echo "no PR to clean up"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
aws s3 rm --recursive s3://$AWS_S3_CACHE/pull-request/$REPO/$PR
|
||||
env:
|
||||
AWS_S3_CACHE: ${{ secrets.AWS_S3_CACHE }}
|
||||
PR: ${{ needs.bottle.outputs.pr }}
|
||||
|
|
|
@ -42,6 +42,8 @@ const artifacts = (await bucket.getObject(key)) ?? panic("No artifacts found")
|
|||
const file = await Deno.open("artifacts.tgz", { create: true, write: true })
|
||||
await artifacts.body.pipeTo(file.writable)
|
||||
|
||||
Deno.stdout.write(new TextEncoder().encode(`PR=${pr}`))
|
||||
|
||||
/// Functions
|
||||
/// -------------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue