Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Dockerfile or vswitch images #7

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool]
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.0.1"
version = "0.0.4"
tag_format = "v$version"
49 changes: 49 additions & 0 deletions .github/workflows/android-dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#############################################################################
# Copyright (c) 2022 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################

name: Docker Android Dep

on:
schedule:
- cron: '0 3 * * *'
push:
branches:
- main

jobs:
build:
name: 'Build'
runs-on: ubuntu-latest
steps:
- name: "Build:checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.0.0

- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{github.repository}}/android-dep
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
registry: ghcr.io
dockerfile: android/ci/Dockerfile_dep
buildargs: BASE_IMAGE=ghcr.io/${{github.repository}}/android-env:latest
tags: latest,${{ steps.previoustag.outputs.tag }}
22 changes: 16 additions & 6 deletions .github/workflows/android-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: Docker Android Environment

on:
schedule:
- cron: '0 0 1 */6 *'
- cron: '0 0 1 */1 *'
push:
branches:
- main
Expand All @@ -28,10 +28,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Build:checkout"
uses: actions/checkout@v2
- name: Build and Publish latest Docker image
uses: VaultVulp/[email protected]
uses: actions/checkout@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
image-name: android-sdk-env
fetch-depth: 0
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.0.0
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{github.repository}}/android-env
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
registry: ghcr.io
dockerfile: android/ci/Dockerfile_env
tags: latest,${{ steps.previoustag.outputs.tag }}
48 changes: 48 additions & 0 deletions .github/workflows/android-hicn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#############################################################################
# Copyright (c) 2022 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################

name: Docker Android Hicn

on:
schedule:
- cron: '0 * * * *'
push:
branches:
- main

jobs:
build:
name: 'Build'
runs-on: ubuntu-latest
steps:
- name: "Build:checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.0.0
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v4
with:
name: ${{github.repository}}/android-hicn
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
registry: ghcr.io
dockerfile: android/ci/Dockerfile_hicn
buildargs: BASE_IMAGE=ghcr.io/${{github.repository}}/android-dep:latest
tags: latest,${{ steps.previoustag.outputs.tag }}
90 changes: 90 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#############################################################################
# Copyright (c) 2022 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##############################################################################

name: Master Branch Job

on:
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
Master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.pull_request.head.ref }}"
repository: "${{ github.event.pull_request.head.repo.full_name}}"
token: "${{ secrets.HICN_ACTIONS_TOKEN }}"
fetch-depth: 0
- name: run
id: run
run: |
echo $GITHUB_SHA
if git describe --tags --exact-match $GITHUB_SHA; then
echo ::set-output name=istag::'true'
else
echo ::set-output name=istag::'false'
fi
git describe --tags --exact-match $GITHUB_SHA | true
PROMOTE=$(echo "${{ github.event.head_commit.message }}" | \
grep -e "#promote" | \
awk '$0 ~ /#promote/ { print "promote" }')
PROMOTE_LEVEL=$(echo "${{ github.event.head_commit.message }}" | \
grep -E "#promote MAJOR|MINOR|PATCH" | \
awk -F '#promote' '{print $2}' | \
awk -F ' ' '{print $1}')
echo ::set-output name=promote::$PROMOTE
echo ::set-output name=promote-level::$PROMOTE_LEVEL
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.0.0
- name: Create bump and changelog
id: cz
if: "!startsWith(github.event.head_commit.message, 'bump:') && steps.run.outputs.promote == 'promote' && steps.run.outputs.promote-level != ''"
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.HICN_ACTIONS_TOKEN }}
increment: ${{ steps.run.outputs.promote-level }}
push: true
changelog: true
- name: Print Version
if: "!startsWith(github.event.head_commit.message, 'bump:') && steps.run.outputs.promote == 'promote' && steps.run.outputs.promote-level != ''"
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
- name: Build and push aar libraries
if: "startsWith(github.event.head_commit.message, 'bump:') && steps.run.outputs.istag == 'true'"
uses: elgohr/Publish-Docker-Github-Action@v4
env:
BASE_IMAGE: ghcr.io/${{github.repository}}/android-hicn:latest
GITHUB_USERNAME: ${{ secrets.HICN_BOT }}
GITHUB_PASSWORD: ${{ secrets.HICN_ACTIONS_TOKEN }}
GITHUB_MVN_REPO: 'https://maven.pkg.github.com/${{github.repository}}'
VERSION: ${{ steps.previoustag.outputs.tag }}
with:
name: ${{github.repository}}/android-build-aar
username: ${{ env.GITHUB_USERNAME }}
password: ${{ env.GITHUB_PASSWORD }}
registry: ghcr.io
dockerfile: android/ci/Dockerfile
buildargs: BASE_IMAGE,GITHUB_USERNAME,GITHUB_PASSWORD,GITHUB_MVN_REPO,VERSION
no_push: true
context: android
53 changes: 33 additions & 20 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
##############################################################################

name: Very job for Android

on:
pull_request:
types:
Expand All @@ -24,23 +26,34 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: "${{ github.event.pull_request.head.ref }}"
repository: "${{ github.event.pull_request.head.repo.full_name}}"
fetch-depth: 0
- name: Capture commit id
id: capture
run: |
COMMIT_ID="$(git rev-parse "${{ github.head_ref }}")"
echo "The sha of the starting commit is $COMMIT_ID"
echo "::set-output name=commit::$COMMIT_ID"
- name: Check commits
uses: manang/[email protected]
- name: compile docker
id: compile
run: |
bash android/ci/docker-build.sh
Verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.pull_request.head.ref }}"
repository: "${{ github.event.pull_request.head.repo.full_name}}"
fetch-depth: 0
- name: Capture commit id
id: capture
run: |
COMMIT_ID="$(git rev-parse "${{ github.head_ref }}")"
echo "The sha of the starting commit is $COMMIT_ID"
echo "::set-output name=commit::$COMMIT_ID"
- name: Check commits
uses: manang/[email protected]
- name: Verify
uses: elgohr/Publish-Docker-Github-Action@v4
env:
BASE_IMAGE: ghcr.io/${{github.repository}}/android-hicn:latest
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{github.repository}}/android-verify
username: ${{ env.GITHUB_USERNAME }}
password: ${{ env.GITHUB_PASSWORD }}
registry: ghcr.io
dockerfile: android/ci/Dockerfile_verify
buildargs: BASE_IMAGE
no_push: true
context: android
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## v0.0.4 (2022-10-27)

### Feat

- change credentials github registry to push public docker images (#36)

## v0.0.3 (2022-10-27)

### Feat

- publish android aar to packages (#34)

## v0.0.2 (2022-10-26)

### Feat

- add multi stage docker images (#33)

### Fix

- **master.yml**: remove personal token (#26)

## v0.0.1 (2022-10-19)

### Feat

- version if promote #promote PATCH (#21)
- **cmake**: warnings old version of cmake, 3.22 needed, 3.18 installed (#20)
- check if commit is conventional commit compliant (#17)
- upgrade dockerfiles to compile environment+dependencies+hicn libraries (#14)
- upgrade android-sdk to support arm64 (#13)
8 changes: 8 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
hicn-aar/FaceMgrLibrary/facemgrLibrary/.cxx
hicn-aar/ForwarderLibrary/facemgrLibrary/.cxx
.distillery.stamp
.versions
build_aarch64
build_x86_64
sdk
src
usr_aarch64
usr_x86_64
5 changes: 4 additions & 1 deletion android/CommonLibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

buildscript {
ext {
VERSION = '1'
MVN_REPO = ''
A_USER = ''
A_PASSWORD = ''
VERSION_NUMBER = 'v0.0.10'
}

repositories {
Expand Down
Loading