From aa4e00cc17758fa47ca5646e8739f3716d47dec9 Mon Sep 17 00:00:00 2001 From: GoldenAnpu Date: Fri, 13 Dec 2024 19:34:42 +0100 Subject: [PATCH] Add GitHub workflows for publishing and releasing the app --- .github/workflows/publish.yml | 19 +++++++++++++++++++ .github/workflows/release.yml | 25 +++++++++++++++++++++++++ .github/workflows/release_branch.yml | 23 +++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/release_branch.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..bd3ad39 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish app to production +run-name: Publish app to production +on: workflow_dispatch +jobs: + Supervisely-Release: + uses: supervisely-ecosystem/workflows/.github/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 }}" + SUPERVISELY_PROD_API_TOKEN: "${{ secrets.SUPERVISELY_PROD_API_TOKEN }}" + GH_ACCESS_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + SUPERVISELY_SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}" + SUPERVISELY_PROD_SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}" + SLUG: "${{ github.repository }}" + RELEASE_VERSION: "" + RELEASE_DESCRIPTION: "" + RELEASE_TYPE: "publish" + SUBAPP_PATHS: "__ROOT_APP__" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f7fba14 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release +run-name: Release version "${{ github.event.release.tag_name }}" +on: + release: + types: [published] + branches: + - main + - master +jobs: + Supervisely-Release: + if: "!github.event.release.prerelease" + uses: supervisely-ecosystem/workflows/.github/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 }}" + SUPERVISELY_PROD_API_TOKEN: "${{ secrets.SUPERVISELY_PROD_API_TOKEN }}" + GH_ACCESS_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + SUPERVISELY_SERVER_ADDRESS: "${{ vars.SUPERVISELY_DEV_SERVER_ADDRESS }}" + SUPERVISELY_PROD_SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}" + SLUG: "${{ github.repository }}" + RELEASE_VERSION: "${{ github.event.release.tag_name }}" + RELEASE_DESCRIPTION: "${{ github.event.release.name }}" + RELEASE_TYPE: "release" + SUBAPP_PATHS: "__ROOT_APP__" diff --git a/.github/workflows/release_branch.yml b/.github/workflows/release_branch.yml new file mode 100644 index 0000000..ff70d18 --- /dev/null +++ b/.github/workflows/release_branch.yml @@ -0,0 +1,23 @@ +name: Release branch +run-name: Release "${{ github.ref_name }}" branch +on: + push: + branches-ignore: + - main + - master +jobs: + Supervisely-Release: + uses: supervisely-ecosystem/workflows/.github/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 }}" + SUPERVISELY_PROD_API_TOKEN: "${{ secrets.SUPERVISELY_PROD_API_TOKEN }}" + GH_ACCESS_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + SUPERVISELY_SERVER_ADDRESS: "${{ vars.SUPERVISELY_DEV_SERVER_ADDRESS }}" + SUPERVISELY_PROD_SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}" + SLUG: "${{ github.repository }}" + RELEASE_VERSION: "${{ github.ref_name }}" + RELEASE_DESCRIPTION: "'${{ github.ref_name }}' branch release" + RELEASE_TYPE: "release-branch" + SUBAPP_PATHS: "__ROOT_APP__"