update(CI): publish wasm package as dev-wasm

Signed-off-by: RohithRaju <rohithraju488@gmail.com>
This commit is contained in:
RohithRaju 2024-01-16 09:57:01 +00:00 committed by poiana
parent 039069d0e1
commit 1b9c2da601
2 changed files with 49 additions and 1 deletions

View File

@ -74,6 +74,12 @@ jobs:
name: falco-${{ inputs.version }}-static-x86_64.tar.gz name: falco-${{ inputs.version }}-static-x86_64.tar.gz
path: /tmp/falco-build-bin-static path: /tmp/falco-build-bin-static
- name: Download WASM package
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: falco-${{ inputs.version }}-wasm.tar.gz
path: /tmp/falco-wasm
- name: Import gpg key - name: Import gpg key
env: env:
GPG_KEY: ${{ secrets.GPG_KEY }} GPG_KEY: ${{ secrets.GPG_KEY }}
@ -84,6 +90,10 @@ jobs:
rpmsign --define '_gpg_name Falcosecurity Package Signing' --addsign /tmp/falco-build-rpm/falco-*.rpm rpmsign --define '_gpg_name Falcosecurity Package Signing' --addsign /tmp/falco-build-rpm/falco-*.rpm
rpm --qf %{SIGPGP:pgpsig} -qp /tmp/falco-build-rpm/falco-*.rpm | grep SHA256 rpm --qf %{SIGPGP:pgpsig} -qp /tmp/falco-build-rpm/falco-*.rpm | grep SHA256
- name: Publish wasm
run: |
./scripts/publish-wasm -f /tmp/falco-wasm/falco-${{ inputs.version }}-wasm.tar.gz
- name: Publish rpm - name: Publish rpm
run: | run: |
./scripts/publish-rpm -f /tmp/falco-build-rpm/falco-${{ inputs.version }}-x86_64.rpm -f /tmp/falco-build-rpm/falco-${{ inputs.version }}-aarch64.rpm -r rpm${{ inputs.bucket_suffix }} ./scripts/publish-rpm -f /tmp/falco-build-rpm/falco-${{ inputs.version }}-x86_64.rpm -f /tmp/falco-build-rpm/falco-${{ inputs.version }}-aarch64.rpm -r rpm${{ inputs.bucket_suffix }}
@ -99,7 +109,7 @@ jobs:
if: false if: false
run: | run: |
./scripts/publish-bin -f /tmp/falco-build-bin-static/falco-${{ inputs.version }}-static-x86_64.tar.gz -r bin${{ inputs.bucket_suffix }} -a x86_64 ./scripts/publish-bin -f /tmp/falco-build-bin-static/falco-${{ inputs.version }}-static-x86_64.tar.gz -r bin${{ inputs.bucket_suffix }} -a x86_64
publish-packages-deb: publish-packages-deb:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: docker.io/debian:stable container: docker.io/debian:stable

38
scripts/publish-wasm Executable file
View File

@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e
usage() {
echo "usage: $0 -f <package.tar.gz>"
exit 1
}
# parse options
while getopts ":f:" opt; do
case "${opt}" in
f )
file=${OPTARG}
;;
\?)
echo "invalid option: ${OPTARG}" >&2
exit 1
;;
esac
done
shift $((OPTIND-1))
if [ -z "${file}" ]; then
usage
fi
repo="dev-wasm"
# settings
s3_bucket_repo="s3://falco-distribution/packages/${repo}"
cloudfront_path="/packages/${repo}"
# publish
package=$(basename -- ${file})
echo "Publishing ${package} to ${s3_bucket_repo}..."
aws s3 cp ${file} ${s3_bucket_repo}/${package} --acl public-read
aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_DIST_ID} --paths ${cloudfront_path}/${package}