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:
|
outputs:
|
||||||
srcs: ${{ env.srcs }}
|
srcs: ${{ env.srcs }}
|
||||||
built: ${{ env.built }}
|
built: ${{ env.built }}
|
||||||
|
pr: ${{ env.PR }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
|
@ -57,7 +58,7 @@ jobs:
|
||||||
name: ${{ matrix.platform.name }}
|
name: ${{ matrix.platform.name }}
|
||||||
path: tea.xyz/var/pantry
|
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 }}
|
if: ${{ !inputs.new-version }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{github.token}}
|
GITHUB_TOKEN: ${{github.token}}
|
||||||
|
@ -231,8 +232,8 @@ jobs:
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [upload]
|
needs: [bottle, upload]
|
||||||
if: startsWith(github.ref, 'refs/pull/') && startsWith(github.repository, 'teaxyz/pantry.')
|
if: ${{ !inputs.new-version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Configure AWS Credentials
|
- name: Configure AWS Credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
@ -242,8 +243,13 @@ jobs:
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- run: |
|
- run: |
|
||||||
REPO=$(echo ${{github.repository}} | sed -e 's_teaxyz/__')
|
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
|
aws s3 rm --recursive s3://$AWS_S3_CACHE/pull-request/$REPO/$PR
|
||||||
env:
|
env:
|
||||||
AWS_S3_CACHE: ${{ secrets.AWS_S3_CACHE }}
|
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 })
|
const file = await Deno.open("artifacts.tgz", { create: true, write: true })
|
||||||
await artifacts.body.pipeTo(file.writable)
|
await artifacts.body.pipeTo(file.writable)
|
||||||
|
|
||||||
|
Deno.stdout.write(new TextEncoder().encode(`PR=${pr}`))
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
/// -------------------------------------------------------------------------------
|
/// -------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue