Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .github/workflows/stable-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ env:
APP_NAME: CortexIDE
ASSETS_REPOSITORY: ${{ github.repository_owner }}/cortexide-binaries
BINARY_NAME: cortexide
GITHUB_BRANCH: ${{ github.ref }}
DISABLE_UPDATE: 'yes'
GH_REPO_PATH: ${{ github.repository_owner }}/cortexide-binaries
ORG_NAME: ${{ github.repository_owner }}
Expand All @@ -49,11 +50,11 @@ jobs:
check:
runs-on: ubuntu-latest
outputs:
MS_COMMIT: ${{ env.MS_COMMIT }}
MS_TAG: ${{ env.MS_TAG }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
MS_COMMIT: ${{ steps.export-check-env.outputs.ms_commit }}
MS_TAG: ${{ steps.export-check-env.outputs.ms_tag }}
RELEASE_VERSION: ${{ steps.export-check-env.outputs.release_version }}
SHOULD_BUILD: ${{ steps.export-check-env.outputs.should_build }}
SHOULD_DEPLOY: ${{ steps.export-check-env.outputs.should_deploy }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -83,6 +84,17 @@ jobs:
CHECK_ALL: 'yes'
run: ./check_tags.sh

- name: Export check results
id: export-check-env
run: |
{
echo "ms_commit=${MS_COMMIT:-}";
echo "ms_tag=${MS_TAG:-}";
echo "release_version=${RELEASE_VERSION:-}";
echo "should_build=${SHOULD_BUILD:-}";
echo "should_deploy=${SHOULD_DEPLOY:-}";
} >> "$GITHUB_OUTPUT"

compile:
needs:
- check
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ env:

ASSETS_REPOSITORY: ${{ github.repository_owner }}/cortexide-binaries
BINARY_NAME: cortexide
GITHUB_BRANCH: ${{ github.ref }}
GH_REPO_PATH: ${{ github.repository_owner }}/cortexide-binaries
ORG_NAME: ${{ github.repository_owner }}
OS_NAME: osx
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/stable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ env:
APP_NAME: CortexIDE
ASSETS_REPOSITORY: ${{ github.repository_owner }}/cortexide-binaries
BINARY_NAME: cortexide
GITHUB_BRANCH: ${{ github.ref }}
GH_REPO_PATH: ${{ github.repository_owner }}/cortexide-binaries
ORG_NAME: ${{ github.repository_owner }}
OS_NAME: windows
Expand All @@ -47,11 +48,11 @@ jobs:
check:
runs-on: ubuntu-latest
outputs:
MS_COMMIT: ${{ env.MS_COMMIT }}
MS_TAG: ${{ env.MS_TAG }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
MS_COMMIT: ${{ steps.export-check-env.outputs.ms_commit }}
MS_TAG: ${{ steps.export-check-env.outputs.ms_tag }}
RELEASE_VERSION: ${{ steps.export-check-env.outputs.release_version }}
SHOULD_BUILD: ${{ steps.export-check-env.outputs.should_build }}
SHOULD_DEPLOY: ${{ steps.export-check-env.outputs.should_deploy }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -81,6 +82,17 @@ jobs:
CHECK_ALL: 'yes'
run: ./check_tags.sh

- name: Export check results
id: export-check-env
run: |
{
echo "ms_commit=${MS_COMMIT:-}";
echo "ms_tag=${MS_TAG:-}";
echo "release_version=${RELEASE_VERSION:-}";
echo "should_build=${SHOULD_BUILD:-}";
echo "should_deploy=${SHOULD_DEPLOY:-}";
} >> "$GITHUB_OUTPUT"

compile:
needs:
- check
Expand Down
66 changes: 40 additions & 26 deletions check_cron_or_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,46 @@

set -e

if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
echo "It's a PR"

export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
echo "It's a Push"

export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
elif [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
if [[ "${GENERATE_ASSETS}" == "true" ]]; then
echo "It will generate the assets"

export SHOULD_BUILD="yes"
export SHOULD_DEPLOY="no"
else
echo "It's a Dispatch"

export SHOULD_DEPLOY="yes"
fi
else
echo "It's a Cron"

export SHOULD_DEPLOY="yes"
fi
# Sensible defaults so downstream jobs always receive explicit values
SHOULD_BUILD="no"
SHOULD_DEPLOY="no"

case "${GITHUB_EVENT_NAME}" in
pull_request)
echo "It's a PR"
SHOULD_BUILD="yes"
SHOULD_DEPLOY="no"
;;
push)
echo "It's a Push"
SHOULD_BUILD="yes"
SHOULD_DEPLOY="no"
;;
workflow_dispatch)
if [[ "${GENERATE_ASSETS}" == "true" ]]; then
echo "Manual dispatch to generate assets"
SHOULD_BUILD="yes"
SHOULD_DEPLOY="no"
else
echo "Manual dispatch for release"
SHOULD_BUILD="yes"
SHOULD_DEPLOY="yes"
fi
;;
repository_dispatch)
echo "Repository dispatch trigger"
SHOULD_BUILD="yes"
SHOULD_DEPLOY="yes"
;;
*)
echo "It's a Cron or other scheduled trigger"
SHOULD_BUILD="yes"
SHOULD_DEPLOY="yes"
;;
esac

export SHOULD_BUILD
export SHOULD_DEPLOY

if [[ "${GITHUB_ENV}" ]]; then
echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> "${GITHUB_ENV}"
Expand Down