Skip to content

Commit

Permalink
Update automation to shared repository (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel authored Feb 17, 2023
1 parent 0e3cac8 commit 5ec9a6d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 268 deletions.
34 changes: 1 addition & 33 deletions .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,4 @@ on:

jobs:
license_tests:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt install python3-dev swig libssl-dev libfann-dev portaudio19-dev libpulse-dev
- name: Install core repo
run: |
pip install .[pi,docker]
- name: Get explicit and transitive dependencies
run: |
pip freeze > requirements-all.txt
- name: Check python
id: license_check_report
uses: pilosus/action-pip-license-checker@v0.5.0
with:
requirements: 'requirements-all.txt'
fail: 'Copyleft,Other,Error'
fails-only: true
exclude: '^(precise-runner|fann2|tqdm|bs4|ovos-phal-plugin|ovos-skill|neon-core|nvidia|neon-phal-plugin).*'
exclude-license: '^(Mozilla|NeonAI License v1.0).*$'
- name: Print report
if: ${{ always() }}
run: echo "${{ steps.license_check_report.outputs.report }}"
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
81 changes: 10 additions & 71 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,76 +6,15 @@ on:
branches:
- master

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/neon_skills

jobs:
tag_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Version
run: |
VERSION=$(python setup.py --version)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
token: ${{secrets.GITHUB_TOKEN}}
tag: ${{env.VERSION}}
build_and_publish_pypi_and_release:
uses: neongeckocom/.github/.github/workflows/publish_stable_release.yml@master
secrets: inherit
build_and_publish_docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get Version
id: version
run: |
VERSION=$(sed "s/a/-a./" <<< $(python setup.py --version))
echo ::set-output name=version::${VERSION}
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for base Docker
id: base_meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
type=ref,event=branch
- name: Build and push base Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.base_meta.outputs.tags }}
labels: ${{ steps.base_meta.outputs.labels }}
target: base

- name: Extract metadata for default_skills Docker
id: default_skills_meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-default_skills
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
type=ref,event=branch
- name: Build and push default_skills Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.default_skills_meta.outputs.tags }}
labels: ${{ steps.default_skills_meta.outputs.labels }}
target: default_skills
needs: build_and_publish_pypi_and_release
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
secrets: inherit
with:
image_name: ${{ github.repository_owner }}/neon_skills
base_tag: base
extra_tag: default_skills
111 changes: 10 additions & 101 deletions .github/workflows/publish_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,106 +8,15 @@ on:
paths-ignore:
- 'version.py'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/neon_skills

jobs:
increment_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Increment Version
run: |
VER=$(python setup.py --version)
python version_bump.py
- name: Push Version Change
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Increment Version
tag_alpha_release:
runs-on: ubuntu-latest
needs: increment_version
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get Version
id: version
run: |
VERSION=$(python setup.py --version)
echo ::set-output name=version::${VERSION}
- name: Create Pre-release
uses: ncipollo/release-action@v1
with:
token: ${{secrets.GITHUB_TOKEN}}
tag: ${{steps.version.outputs.version}}
commit: ${{ github.ref }}
prerelease: true
build_and_publish_pypi:
uses: neongeckocom/.github/.github/workflows/publish_alpha_release.yml@master
secrets: inherit
build_and_publish_docker:
runs-on: ubuntu-latest
needs: increment_version
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get Version
id: version
run: |
VERSION=$(sed "s/a/-a./" <<< $(python setup.py --version))
echo ::set-output name=version::${VERSION}
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for base Docker
id: base_meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
type=ref,event=branch
- name: Build and push base Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.base_meta.outputs.tags }}
labels: ${{ steps.base_meta.outputs.labels }}
target: base

- name: Extract metadata for default_skills Docker
id: default_skills_meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-default_skills
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
type=ref,event=branch
- name: Build and push default_skills Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.default_skills_meta.outputs.tags }}
labels: ${{ steps.default_skills_meta.outputs.labels }}
target: default_skills
needs: build_and_publish_pypi
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
secrets: inherit
with:
image_name: ${{ github.repository_owner }}/neon_skills
base_tag: base
extra_tag: default_skills
15 changes: 4 additions & 11 deletions .github/workflows/pull_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@ on:
push:
branches:
- dev
workflow_dispatch:

jobs:
pull_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: pull-request-action
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_reviewer: 'neonreviewers'
pr_assignee: 'neondaniel'
pr_draft: true
uses: neongeckocom/.github/.github/workflows/pull_master.yml@master
with:
pr_reviewer: neonreviewers
pr_assignee: neondaniel
21 changes: 6 additions & 15 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,13 @@ on:
push:
workflow_dispatch:

# TODO: Run tests here for everything in NeonCore
jobs:
build_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Build Distribution Packages
run: |
python setup.py bdist_wheel
py_build_tests:
uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master
with:
python_version: "3.8"
docker_build_tests:
uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master
util_tests:
strategy:
matrix:
Expand Down
44 changes: 7 additions & 37 deletions .github/workflows/update_skills_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,11 @@ name: Update Skills Image
on:
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/neon_skills

jobs:
update_default_skills_image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for default_skills Docker
id: default_skills_meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-default_skills
tags: |
type=ref,event=branch
- name: Build and push default_skills Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.default_skills_meta.outputs.tags }}
labels: ${{ steps.default_skills_meta.outputs.labels }}
target: default_skills
build_and_publish_docker:
needs: build_and_publish_pypi
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
secrets: inherit
with:
image_name: ${{ github.repository_owner }}/neon_skills-default_skills
base_tag: default_skills

0 comments on commit 5ec9a6d

Please sign in to comment.