Skip to content
2 changes: 1 addition & 1 deletion .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:

Supervisely-Release:
needs: Update-App-Config
uses: supervisely-ecosystem/workflows/.github/workflows/common.yml@master
uses: supervisely/agent/.github/workflows/workflows-common.yml@master
secrets:
SUPERVISELY_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_DEV_API_TOKEN }}"
SUPERVISELY_PRIVATE_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_PRIVATE_DEV_API_TOKEN }}"
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/build-push-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Write Tag to ENV variable
run: echo "BRANCH_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV

Expand All @@ -24,10 +30,10 @@ jobs:
--local dockerfile=. \
--output type=image,name=supervisely/agent:dev,push=true \
--opt provenance=false \
--opt build-arg=LABEL_VERSION=6.999.0 \
--opt build-arg=LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg=LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg=LABEL_README=${{ env.LABEL_README }} \
--opt build-arg=LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--opt build-arg:LABEL_VERSION=6.999.0 \
--opt build-arg:LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg:LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg:LABEL_README=${{ env.LABEL_README }} \
--opt build-arg:LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--import-cache type=registry,ref=supervisely/agent:dev-cache \
--export-cache type=registry,ref=supervisely/agent:dev-cache,mode=max
17 changes: 11 additions & 6 deletions .github/workflows/build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Echo ${{ github.event.release.tag_name }}
run: echo ${{ github.event.release.tag_name }}

Expand All @@ -31,11 +36,11 @@ jobs:
--local dockerfile=. \
--output type=image,name=supervisely/agent:${{ env.LABEL_VERSION }},push=true \
--opt provenance=false \
--opt build-arg=LABEL_VERSION=agent:${{ env.LABEL_VERSION }} \
--opt build-arg=LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg=LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg=LABEL_README=${{ env.LABEL_README }} \
--opt build-arg=LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--opt build-arg:LABEL_VERSION=agent:${{ env.LABEL_VERSION }} \
--opt build-arg:LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg:LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg:LABEL_README=${{ env.LABEL_README }} \
--opt build-arg:LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--import-cache type=registry,ref=supervisely/agent:cache \
--export-cache type=registry,ref=supervisely/agent:cache,mode=max

Expand All @@ -44,7 +49,7 @@ jobs:
permissions:
contents: write
actions: write
uses: supervisely/agent/.github/workflows/app-release.yml@app-release
uses: supervisely/agent/.github/workflows/app-release.yml@master
secrets:
SUPERVISELY_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_DEV_API_TOKEN }}"
SUPERVISELY_PRIVATE_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_PRIVATE_DEV_API_TOKEN }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
permissions:
contents: write
actions: write
uses: supervisely/agent/.github/workflows/app-release.yml@app-release
uses: supervisely/agent/.github/workflows/app-release.yml@master
secrets:
SUPERVISELY_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_DEV_API_TOKEN }}"
SUPERVISELY_PRIVATE_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_PRIVATE_DEV_API_TOKEN }}"
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/manual-build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
tag_version:
description: "Docker Image Tag"
description: "Docker Image Tag (without 'v' prefix)"
required: true
default: ""
release_description:
Expand All @@ -20,6 +20,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Tag Version
run: echo ${{ github.event.inputs.tag_version }}

Expand All @@ -37,11 +42,11 @@ jobs:
--local dockerfile=. \
--output type=image,name=supervisely/agent:${{ env.LABEL_VERSION }},push=true \
--opt provenance=false \
--opt build-arg=LABEL_VERSION=agent:${{ env.LABEL_VERSION }} \
--opt build-arg=LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg=LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg=LABEL_README=${{ env.LABEL_README }} \
--opt build-arg=LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--opt build-arg:LABEL_VERSION=agent:${{ env.LABEL_VERSION }} \
--opt build-arg:LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg:LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg:LABEL_README=${{ env.LABEL_README }} \
--opt build-arg:LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--import-cache type=registry,ref=supervisely/agent:cache \
--export-cache type=registry,ref=supervisely/agent:cache,mode=max

Expand All @@ -50,7 +55,7 @@ jobs:
permissions:
contents: write
actions: write
uses: supervisely/agent/.github/workflows/app-release.yml@app-release
uses: supervisely/agent/.github/workflows/app-release.yml@master
secrets:
SUPERVISELY_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_DEV_API_TOKEN }}"
SUPERVISELY_PRIVATE_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_PRIVATE_DEV_API_TOKEN }}"
Expand All @@ -59,5 +64,5 @@ jobs:
with:
SUPERVISELY_SERVER_ADDRESS: "${{ vars.SUPERVISELY_DEV_SERVER_ADDRESS }}"
SUPERVISELY_PROD_SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}"
RELEASE_VERSION: "${{ inputs.tag_version }}"
RELEASE_VERSION: "v${{ inputs.tag_version }}"
RELEASE_DESCRIPTION: "${{ inputs.release_description }}"
122 changes: 122 additions & 0 deletions .github/workflows/workflows-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Supervisely release
run-name: Supervisely ${{ github.repository }} app release
on:
workflow_call:
inputs:
SUPERVISELY_SERVER_ADDRESS:
required: true
type: string
SUPERVISELY_PROD_SERVER_ADDRESS:
required: true
type: string
SLUG:
required: true
type: string
RELEASE_VERSION:
required: true
type: string
RELEASE_DESCRIPTION:
required: true
type: string
SUBAPP_PATHS:
required: true
type: string
RELEASE_TYPE:
required: true
type: string
SKIP_INSTANCE_VERSION_VALIDATION:
required: false
type: boolean
default: false
SKIP_IMAGE_VALIDATION:
required: false
type: boolean
default: false
ARCHIVE_ONLY_CONFIG:
required: false
type: boolean
default: false
COMMIT_SHA:
required: false
type: string
default: ""
MODELS_PATH:
required: false
type: string
default: ""
FRAMEWORK:
required: false
type: string
default: ""
RELEASE_MODELS:
required: false
type: boolean
default: false
secrets:
SUPERVISELY_DEV_API_TOKEN:
required: true
SUPERVISELY_PRIVATE_DEV_API_TOKEN:
required: true
SUPERVISELY_PROD_API_TOKEN:
required: true
GH_ACCESS_TOKEN:
required: true

jobs:
Supervisely-Release:
runs-on: gha-runner-supervisely
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.COMMIT_SHA }}
fetch-depth: 0

- uses: actions/checkout@v6
with:
repository: supervisely-ecosystem/workflows
path: workflow

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1 libmagic1 skopeo
python -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
pip install -r ./workflow/requirements.txt

- name: Supervisely Release
run: |
. venv/bin/activate
python ./workflow/release.py
env:
DEV_SERVER_ADDRESS: "${{ inputs.SUPERVISELY_SERVER_ADDRESS }}"
PROD_SERVER_ADDRESS: "${{ inputs.SUPERVISELY_PROD_SERVER_ADDRESS }}"
DEV_API_TOKEN: "${{ secrets.SUPERVISELY_DEV_API_TOKEN }}"
PRIVATE_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_PRIVATE_DEV_API_TOKEN }}"
PROD_API_TOKEN: "${{ secrets.SUPERVISELY_PROD_API_TOKEN }}"
GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}"
SLUG: "${{ inputs.SLUG }}"
RELEASE_VERSION: "${{ inputs.RELEASE_VERSION }}"
RELEASE_DESCRIPTION: "${{ inputs.RELEASE_DESCRIPTION }}"
RELEASE_TYPE: "${{ inputs.RELEASE_TYPE }}"
SUBAPP_PATHS: "${{ inputs.SUBAPP_PATHS }}"
SKIP_INSTANCE_VERSION_VALIDATION: "${{ inputs.SKIP_INSTANCE_VERSION_VALIDATION }}"
SKIP_IMAGE_VALIDATION: "${{ inputs.SKIP_IMAGE_VALIDATION }}"
ARCHIVE_ONLY_CONFIG: "${{ inputs.ARCHIVE_ONLY_CONFIG }}"

Models-release:
needs: Supervisely-Release
if: inputs.RELEASE_MODELS && inputs.RELEASE_TYPE != 'release-branch'
uses: supervisely/agent/.github/workflows/workflows-sync-models-common.yml@master
secrets:
API_TOKEN: "${{ secrets.SUPERVISELY_PROD_API_TOKEN }}"
with:
SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}"
MODELS_PATH: "${{ inputs.MODELS_PATH }}"
FRAMEWORK: "${{ inputs.FRAMEWORK }}"
53 changes: 53 additions & 0 deletions .github/workflows/workflows-sync-models-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Sync Models
on:
workflow_call:
inputs:
MODELS_PATH:
type: string
required: false
DET_MODELS_PATH:
type: string
required: false
FRAMEWORK:
type: string
required: true
SERVER_ADDRESS:
type: string
required: true
secrets:
API_TOKEN:
required: true

jobs:
release-models:
runs-on: gha-runner-supervisely
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
repository: supervisely-ecosystem/workflows
path: workflow

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install dependencies
run: |
sudo apt-get update
python -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
pip install -r workflow/requirements.txt

- name: Sync models
run: |
. venv/bin/activate
python workflow/release_models.py
env:
SERVER_ADDRESS: ${{ inputs.SERVER_ADDRESS }}
API_TOKEN: ${{ secrets.API_TOKEN }}
MODELS_PATH: ${{ inputs.MODELS_PATH }}
DET_MODELS_PATH: ${{ inputs.DET_MODELS_PATH }}
FRAMEWORK: ${{ inputs.FRAMEWORK }}