From d7bd15cf6b87fd7ca89a54b7eec0a8dd663c20b7 Mon Sep 17 00:00:00 2001 From: Core <64542347+coredev-uk@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:19:15 +0100 Subject: [PATCH] Removed the checkout shit --- .github/workflows/build-macos.yml | 6 ------ resources/version.sh | 13 ++++--------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index a146cbba..b3904ee2 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -45,12 +45,6 @@ jobs: with: xcode-version: '12.4' - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: ${{ github.sha }} - submodules: true - - name: Change Version run: sudo chmod +x resources/version.sh && ./resources/version.sh || true diff --git a/resources/version.sh b/resources/version.sh index 45fbd8b1..6a895302 100755 --- a/resources/version.sh +++ b/resources/version.sh @@ -1,14 +1,9 @@ #!/bin/bash -# DEBUGGING -STABLE_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep sha | cut -d '"' -f 4 | sed 's/v//' | xargs | cut -d' ' -f1 | head -n 1) -COMMITSINCESTABLE=$(git rev-list $STABLE_SHA..$GITHUB_SHA --count) +STABLE_SHA=$(curl -s https://api.github.com/repos/ciderapp/Cider/branches/stable | grep '"sha"' | head -1 | cut -d '"' -f 4) +SHA_DATE=$(git show -s --format=%ci $STABLE_SHA) +COMMITSINCESTABLE=$(git rev-list $STABLE_SHA..HEAD --count --since="$SHA_DATE") CURRENT_VERSION=$(node -p -e "require('./package.json').version") - -git rev-list --all - -############################################################################################# - if [[ ($CIRCLE_BRANCH == "main" || $GITHUB_REF_NAME == "main") && $COMMITSINCESTABLE -gt 0 ]]; then NEW_VERSION="${CURRENT_VERSION}-beta.${COMMITSINCESTABLE}" else @@ -26,4 +21,4 @@ if [[ -z "${GITHUB_ENV}" ]]; then echo "APP_VERSION=$(node -p -e 'require("./package.json").version')" >>$GITHUB_ENV elif [[ -z "${BASH_ENV}" ]]; then echo "export APP_VERSION=$(node -p -e 'require("./package.json").version')" >>$BASH_ENV -fi +fi \ No newline at end of file