mirror of
https://github.com/ivabus/pantry
synced 2024-11-25 18:05:07 +03:00
fix CF invalidate
matrices don't output stable or combined data, so we weren't invalidating everything we think we were.
This commit is contained in:
parent
f238471639
commit
e582f2844f
1 changed files with 11 additions and 7 deletions
18
.github/workflows/pkg-platform.yml
vendored
18
.github/workflows/pkg-platform.yml
vendored
|
@ -115,8 +115,6 @@ jobs:
|
|||
matrix:
|
||||
compression: [xz, gz]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
paths: ${{ steps.put.outputs.cf-paths }}
|
||||
env:
|
||||
PREFIX: ${{ needs.build.outputs.project }}/${{ needs.build.outputs.platform }}/${{ needs.build.outputs.arch }}/v${{ needs.build.outputs.version }}.tar.${{ matrix.compression }}
|
||||
steps:
|
||||
|
@ -173,6 +171,13 @@ jobs:
|
|||
id: put
|
||||
if: ${{ ! inputs.dry-run }}
|
||||
|
||||
- name: invalidate cloudfront
|
||||
run: aws cloudfront create-invalidation
|
||||
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }}
|
||||
--paths
|
||||
${{ steps.put.outputs.cf-paths }}
|
||||
if: ${{ ! inputs.dry-run }}
|
||||
|
||||
publish:
|
||||
name: publish ${{inputs.tinyname}} ${{ inputs.dry-run && '(dry-run)' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -191,7 +196,7 @@ jobs:
|
|||
- name: generate versions.txt
|
||||
run: |
|
||||
if ! aws s3 cp \
|
||||
s3://${{ secrets.AWS_S3_BUCKET }}/${{ needs.build.outputs.project }}/${{ needs.build.outputs.platform }}/${{ needs.build.outputs.arch }}/versions.txt \
|
||||
s3://${{ secrets.AWS_S3_BUCKET }}/$DIRNAME/versions.txt \
|
||||
./remote-versions.txt; then
|
||||
touch remote-versions.txt
|
||||
fi
|
||||
|
@ -200,9 +205,9 @@ jobs:
|
|||
env:
|
||||
SCRIPT: |
|
||||
import SemVer, { compare } from "https://raw.githubusercontent.com/pkgxdev/libpkgx/main/src/utils/semver.ts"
|
||||
const versions = Deno.readTextFileSync(Deno.args[0]).trim().split("\n").filter(x => x)
|
||||
versions.push(Deno.args[1])
|
||||
const out = versions.map(x => new SemVer(x)).sort(compare).join("\n")
|
||||
const versions = new Set(Deno.readTextFileSync(Deno.args[0]).trim().split("\n").filter(x => x))
|
||||
versions.add(Deno.args[1])
|
||||
const out = [...versions].map(x => new SemVer(x)).sort(compare).join("\n")
|
||||
await Deno.stdout.write(new TextEncoder().encode(out.trim()))
|
||||
|
||||
- name: s3 put
|
||||
|
@ -214,7 +219,6 @@ jobs:
|
|||
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }}
|
||||
--paths
|
||||
/$DIRNAME/versions.txt
|
||||
${{ needs.bottle.outputs.paths }}
|
||||
if: ${{ ! inputs.dry-run }}
|
||||
|
||||
complain:
|
||||
|
|
Loading…
Reference in a new issue