To enable app releases you need to add .github/workflows/release.yml file into your app repository.
These env vars must be configured on the GitHub Actions runner:
SUPERVISELY_PROD_SERVER_ADDRESSSUPERVISELY_PROD_API_TOKENSUPERVISELY_GITHUB_ACCESS_TOKEN
name: Supervisely release
run-name: Supervisely ${{ github.repository }} app release
on:
release:
types: [published]
branches:
- main
- master
jobs:
Supervisely-Release:
uses: supervisely-ecosystem/workflows/.github/workflows/common.yml@master
with:
SLUG: "${{ github.repository }}"
RELEASE_VERSION: "${{ github.event.release.tag_name }}"
RELEASE_TITLE: "${{ github.event.release.name }}"
IGNORE_SLY_RELEASES: 1
RELEASE_WITH_SLUG: 1
CHECK_PREV_RELEASES: 1
SUBAPP_PATHS: "__ROOT_APP__, subapp"SUBAPP_PATHS - list of sub app paths, separated by comma. If you don't have sub apps, just leave __ROOT_APP__.
- Sub apps located in
/trainand/servefolders
SUBAPP_PATHS: "train, serve"- Main app only
SUBAPP_PATHS: "__ROOT_APP__"To enable branch app releases you need to add .github/workflows/release_branch.yml file into your app repository.
Each time there is a push to a branch, a new release with release version and release name equal to the branch name will be created.
Optional behavior: set BUILD_TEST_IMAGE_ON_RELEASE: "true" to build a test image before branch release, but only when dev_requirements.txt differs from master.
These env vars must be configured on the GitHub Actions runner:
SUPERVISELY_PROD_SERVER_ADDRESSSUPERVISELY_PROD_API_TOKENSUPERVISELY_GITHUB_ACCESS_TOKENSUPERVISELY_DEV_API_TOKENSUPERVISELY_PRIVATE_DEV_API_TOKEN
name: Supervisely release
run-name: Supervisely ${{ github.repository }} app release
on:
push:
branches-ignore:
- main
- master
env:
BUILD_TEST_IMAGE_ON_RELEASE: "false"
jobs:
Check-Dev-Requirements:
runs-on: ubuntu-latest
outputs:
enabled: ${{ steps.flag.outputs.enabled }}
changed: ${{ steps.diff.outputs.changed }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check feature flag
id: flag
run: |
if [ "${{ env.BUILD_TEST_IMAGE_ON_RELEASE }}" = "true" ]; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
fi
- name: Fetch master branch
if: ${{ steps.flag.outputs.enabled == 'true' }}
run: |
git fetch origin master:refs/remotes/origin/master
- name: Check dev_requirements.txt changes
id: diff
run: |
if [ "${{ steps.flag.outputs.enabled }}" != "true" ]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --quiet origin/master...HEAD -- dev_requirements.txt; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
Build-Test-Image:
needs: Check-Dev-Requirements
if: ${{ needs.Check-Dev-Requirements.outputs.enabled == 'true' && needs.Check-Dev-Requirements.outputs.changed == 'true' }}
uses: supervisely-ecosystem/workflows/.github/workflows/build_image_from_template.yml@master
with:
tag_version: "test"
skip_tag_check: true
Supervisely-Release:
needs:
- Check-Dev-Requirements
- Build-Test-Image
if: ${{ always() && (needs.Check-Dev-Requirements.outputs.enabled != 'true' || needs.Check-Dev-Requirements.outputs.changed == 'false' || needs.Build-Test-Image.result == 'success') }}
uses: supervisely-ecosystem/workflows/.github/workflows/common.yml@master
with:
SLUG: "${{ github.repository }}"
RELEASE_VERSION: "${{ github.ref_name }}"
RELEASE_DESCRIPTION: "'${{ github.ref_name }}' branch release"
RELEASE_TYPE: "release-branch"
SUBAPP_PATHS: "__ROOT_APP__, subapp"SUBAPP_PATHS - list of sub app paths, separated by comma. If you don't have sub apps, just leave __ROOT_APP__.
- Sub apps located in
/trainand/servefolders
SUBAPP_PATHS: "train, serve"- Main app only
SUBAPP_PATHS: "__ROOT_APP__"For neural network applications, the workflow automatically determines framework and models file path using the following rules:
If FRAMEWORK and MODELS_PATH variables are already set in workflow inputs, they are used without searching for configuration.
If variables are not set, the script searches for the train folder in the following order:
- Path:
supervisely_integration/train/ - Path:
train/(in repository root)
The config.json file must exist in the found train folder with the following structure:
{
"framework": {
"name": "SparseInst"
},
"files": {
"models": "models/models.json"
}
}Extracted fields:
framework.name→ environment variableFRAMEWORKfiles.models→ environment variableMODELS_PATH
The extracted values automatically become available in subsequent workflow steps via environment variables.