update scanner ci with qemu arm64 #55
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Elkeid_plugin_scanner_release | |
on: | |
push: | |
tags: | |
- scanner-v* | |
jobs: | |
build_arm64: | |
runs-on: ubuntu-latest | |
env: | |
PLATFORMS: linux/amd64, linux/arm64 | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: false | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
password: ${{secrets.DOCKERHUB_TOKEN}} | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/arm64 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Scanner | |
run: | | |
docker run --rm --pull=always -v $(pwd):/Elkeid kulukami/libclamav_icm_aarch64:0.104 \ | |
bash /Elkeid/plugins/scanner/docker/build_linux_aarch64.sh | |
- name: Upload Scanner | |
uses: actions/upload-artifact@v3 | |
with: | |
path: plugins/scanner/output/scanner-aarch64.tar.gz | |
name: scanner_arm64 | |
build_x86_64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Scanner | |
run: | | |
docker run --rm --pull=always -v $(pwd):/Elkeid kulukami/libclamav_icm_x86_64:0.104 \ | |
bash /Elkeid/plugins/scanner/docker/build_linux_x86_64.sh | |
- name: Upload Scanner | |
uses: actions/upload-artifact@v3 | |
with: | |
path: plugins/scanner/output/scanner-x86_64.tar.gz | |
name: scanner_x86_64 | |
release_all: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
draft: false | |
prerelease: false | |
release_name: Release ${{github.ref}} | |
tag_name: ${{github.ref}} | |
- uses: actions/download-artifact@v3 | |
with: | |
path: ~/scanner_packages | |
- name: Prepare artifact 1 mkdir | |
run: mkdir -p elkeid_scanner | |
- name: Prepare artifact 2 mv files | |
run: mv -f ~/scanner_packages/*/* elkeid_scanner/. || true | |
- name: Pack artifact | |
run: zip -r elkeid_scanner.zip elkeid_scanner | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
asset_content_type: application/zip | |
asset_name: elkeid_scanner.zip | |
asset_path: ./elkeid_scanner.zip | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
needs: | |
- build_arm64 | |
- build_x86_64 |