Skip to content

[jimple] Soot api improvements for android (#120) #334

[jimple] Soot api improvements for android (#120)

[jimple] Soot api improvements for android (#120) #334

Workflow file for this run

name: Upload Container image
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch: # allow to manually trigger this workflow
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: appthreat/chen-platform
jobs:
deploy:
if: github.repository_owner == 'appthreat'
strategy:
fail-fast: true
matrix:
image:
- arch: amd64
- arch: arm64
runner-suffix: -arm
runs-on: ubuntu-24.04${{ matrix.image.runner-suffix }}
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.3"
tools: composer:v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '23.x'
- uses: oras-project/setup-oras@v1
if: matrix.image.arch == 'amd64'
- name: Trim CI agent
run: |
chmod +x ci/free_disk_space.sh
./ci/free_disk_space.sh
- name: Delete `.rustup` directory
run: rm -rf /home/runner/.rustup # to save disk space
if: runner.os == 'Linux'
- name: Delete `.cargo` directory # to save disk space
run: rm -rf /home/runner/.cargo
if: runner.os == 'Linux'
- uses: actions/cache@v4
with:
path: |
~/.sbt
~/.coursier
key: ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
- run: |
sbt stage createDistribution
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCALAPY_PYTHON_LIBRARY: "python3.12"
- name: Export python requirements
if: matrix.image.arch == 'amd64'
run: |
python3.12 -m pip install --upgrade pip setuptools
python3.12 -m pip install poetry
python3.12 -m poetry self add poetry-plugin-export
python3.12 -m poetry export -f requirements.txt --with=science --without-hashes --output target/chen-science-requirements.txt
python3.12 -m poetry export -f requirements.txt --with=database --without-hashes --output target/chen-database-requirements.txt
- name: Upload chen to ghcr
if: matrix.image.arch == 'amd64'
run: |
cd target
echo $GITHUB_TOKEN | oras login ghcr.io -u $GITHUB_USERNAME --password-stdin
oras push ghcr.io/$IMAGE_NAME:v2 \
--annotation-file ../ci/annotations.json \
./chen.zip:application/vnd.appthreat.chen.layer.v1+tar \
./chen-science-requirements.txt:application/vnd.appthreat.chen.layer.v1+tar \
./chen-database-requirements.txt:application/vnd.appthreat.chen.layer.v1+tar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/appthreat/chen
flavor: latest=false,suffix=-${{ matrix.image.arch }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
id: build
with:
file: ci/Dockerfile
context: .
platforms: linux/${{ matrix.image.arch }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: deploy
matrix-key: ${{ matrix.image.arch }}
outputs: |-
image-uri: ghcr.io/appthreat/chen@${{ steps.build.outputs.digest }}
deploy-manifest:
if: github.repository_owner == 'appthreat'
runs-on: ubuntu-24.04
needs: [deploy]
outputs:
image-uri: ghcr.io/appthreat/chen@${{ steps.build.outputs.digest }}
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/${{ github.repository }}
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: deploy
- uses: int128/docker-manifest-create-action@v2
id: build
with:
index-annotations: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
sources: |
${{ fromJSON(steps.read.outputs.result).image-uri.amd64 }}
${{ fromJSON(steps.read.outputs.result).image-uri.arm64 }}