Skip to content

supervisely-ecosystem/workflows

Repository files navigation

Main releases

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_ADDRESS
  • SUPERVISELY_PROD_API_TOKEN
  • SUPERVISELY_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__.

Examples:

  1. Sub apps located in /train and /serve folders
SUBAPP_PATHS: "train, serve"
  1. Main app only
SUBAPP_PATHS: "__ROOT_APP__"

Branch releases

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_ADDRESS
  • SUPERVISELY_PROD_API_TOKEN
  • SUPERVISELY_GITHUB_ACCESS_TOKEN
  • SUPERVISELY_DEV_API_TOKEN
  • SUPERVISELY_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__.

Examples:

  1. Sub apps located in /train and /serve folders
SUBAPP_PATHS: "train, serve"
  1. Main app only
SUBAPP_PATHS: "__ROOT_APP__"

Models Release and Updates

Configuration Discovery Rules

For neural network applications, the workflow automatically determines framework and models file path using the following rules:

1. Environment Variables Priority

If FRAMEWORK and MODELS_PATH variables are already set in workflow inputs, they are used without searching for configuration.

2. Train Folder Search

If variables are not set, the script searches for the train folder in the following order:

  1. Path: supervisely_integration/train/
  2. Path: train/ (in repository root)

3. Parsing config.json

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 variable FRAMEWORK
  • files.models → environment variable MODELS_PATH

4. Usage in Workflow

The extracted values automatically become available in subsequent workflow steps via environment variables.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors