From 1865fabf3087a09b3d54a28b9bfa5042d8dce562 Mon Sep 17 00:00:00 2001 From: Nikolai Petukhov Date: Fri, 11 Aug 2023 22:27:22 -0300 Subject: [PATCH] Update workflows --- .github/workflows/publish.yml | 19 +++++++++++++++++++ .github/workflows/release.yml | 18 ++++++++++-------- .github/workflows/release_branch.yml | 23 +++++++++++++++++++++++ .github/workflows/release_dev.yml | 23 ----------------------- 4 files changed, 52 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release_branch.yml delete mode 100644 .github/workflows/release_dev.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 index 914ddb9..f7fba14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ -name: Supervisely release -run-name: Supervisely ${{ github.repository }} app release +name: Release +run-name: Release version "${{ github.event.release.tag_name }}" on: release: types: [published] @@ -8,16 +8,18 @@ on: - master jobs: Supervisely-Release: + if: "!github.event.release.prerelease" uses: supervisely-ecosystem/workflows/.github/workflows/common.yml@master secrets: - SUPERVISELY_API_TOKEN: "${{ secrets.SUPERVISELY_PROD_API_TOKEN }}" + 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_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_TITLE: "${{ github.event.release.name }}" - IGNORE_SLY_RELEASES: 1 - RELEASE_WITH_SLUG: 1 - CHECK_PREV_RELEASES: 1 + 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__" diff --git a/.github/workflows/release_dev.yml b/.github/workflows/release_dev.yml deleted file mode 100644 index e7891ee..0000000 --- a/.github/workflows/release_dev.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Supervisely release -run-name: Supervisely ${{ github.repository }} app release -on: - push: - branches-ignore: - - main - - master -jobs: - Supervisely-Release: - uses: supervisely-ecosystem/workflows/.github/workflows/common.yml@master - secrets: - SUPERVISELY_API_TOKEN: "${{ secrets.SUPERVISELY_DEV_API_TOKEN }}" - GH_ACCESS_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - with: - SUPERVISELY_SERVER_ADDRESS: "${{ vars.SUPERVISELY_DEV_SERVER_ADDRESS }}" - SLUG: "${{ github.repository }}" - RELEASE_VERSION: "${{ github.ref_name }}" - RELEASE_TITLE: "${{ github.ref_name }} branch release" - IGNORE_SLY_RELEASES: 1 - RELEASE_WITH_SLUG: 1 - CHECK_PREV_RELEASES: 0 - SUBAPP_PATHS: "__ROOT_APP__" - \ No newline at end of file