diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1aeb5987..557af1d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,14 @@ jobs: env: OS_NAME: ${{ matrix.os-name }} run: | + python ./resources/ci/common/prepare_appversion.py python ./resources/ci/common/prepare_release.py + # upload appversion artifact for later step + - name: Upload AppVersion Artifact + uses: actions/upload-artifact@v1 + with: + name: appversion-${{ matrix.os-name }} + path: ./resources/app/meta/manifests/app_version.txt # upload archive artifact for later step - name: Upload Archive Artifact uses: actions/upload-artifact@v1 diff --git a/resources/ci/common/install.py b/resources/ci/common/install.py index 8cd40df2..44118725 100644 --- a/resources/ci/common/install.py +++ b/resources/ci/common/install.py @@ -2,6 +2,11 @@ import common import os # for env vars import subprocess # do stuff at the shell level +from Main import __version__ as DRVersion + +with(open(os.path.join("resources","app","meta","manifests","app_version.txt"),"w+")) as f: + f.write(DRVersion) + env = common.prepare_env() # get executables diff --git a/resources/ci/common/prepare_appversion.py b/resources/ci/common/prepare_appversion.py new file mode 100644 index 00000000..bd26318e --- /dev/null +++ b/resources/ci/common/prepare_appversion.py @@ -0,0 +1,20 @@ +import common +import os # for env vars +from shutil import copy # file manipulation + +env = common.prepare_env() + +# set tag to app_version.txt +if not env["GITHUB_TAG"] == "": + with open(os.path.join(".","resources","app","meta","manifests","app_version.txt"),"w+") as f: + _ = f.read() + f.seek(0) + f.write(env["GITHUB_TAG"]) + f.truncate() + +if not os.path.isdir(os.path.join("..","build")): + os.mkdir(os.path.join("..","build")) +copy( + os.path.join(".","resources","app","meta","manifests","app_version.txt"), + os.path.join("..","build","app_version.txt") +) diff --git a/resources/ci/common/prepare_binary.py b/resources/ci/common/prepare_binary.py index 583c7d7b..bc4e0d09 100644 --- a/resources/ci/common/prepare_binary.py +++ b/resources/ci/common/prepare_binary.py @@ -7,6 +7,9 @@ from shutil import copy, make_archive, move, rmtree # file manipulation env = common.prepare_env() +if "OS_NAME" in env and env["OS_NAME"] == "osx": + subprocess.check_call(["ls","-l"]) + # make dir to put the binary in if not os.path.isdir(os.path.join("..","artifact")): os.mkdir(os.path.join("..","artifact"))