From 7ebc904af3d08d09f8fc6c89ad3b5492993d5733 Mon Sep 17 00:00:00 2001 From: Thomas Schaper Date: Mon, 18 Jan 2021 10:57:16 +0100 Subject: [PATCH 01/11] Build mac os on github actions --- .github/workflows/mac.yml | 29 +++++++++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/mac.yml diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 00000000..3760c9f2 --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,29 @@ +--- +name: "Mac build" + +"on": + push: + branches: + - feature/gh-actions-mac + - release/* + +jobs: + build: + runs-on: macos-11.0 + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.6 + + - uses: actions/setup-node@v2 + with: + node-version: '12' + + - name: Make python virtual env + run: python3 -m venv .env + + - name: Build binary + run: make build-quick diff --git a/Makefile b/Makefile index 88afe176..021ccb9a 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ env/.install-deps-$(UNAME): requirements-$(UNAME).txt | env $(ENV) pip3 install -r $^ date >$@ node_modules/.install-deps: package.json - npm install + npm ci date >$@ .PHONY: install From 3ad49c3f8469eaed1e15c33bdbfb79b056a88d71 Mon Sep 17 00:00:00 2001 From: Thomas Schaper Date: Mon, 18 Jan 2021 11:15:57 +0100 Subject: [PATCH 02/11] Change mac version --- .github/workflows/mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 3760c9f2..b2669fa2 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -9,7 +9,7 @@ name: "Mac build" jobs: build: - runs-on: macos-11.0 + runs-on: macos-10.15 steps: - uses: actions/checkout@v2 From 414c25320ea47ec00b2ab18254f7770e15a0c907 Mon Sep 17 00:00:00 2001 From: Thomas Schaper Date: Mon, 18 Jan 2021 11:18:58 +0100 Subject: [PATCH 03/11] Fix virtual env config --- .github/workflows/mac.yml | 3 --- .gitignore | 1 + Makefile | 11 ++++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index b2669fa2..ccb8ad1f 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -22,8 +22,5 @@ jobs: with: node-version: '12' - - name: Make python virtual env - run: python3 -m venv .env - - name: Build binary run: make build-quick diff --git a/.gitignore b/.gitignore index cd0f8f41..4e00f99f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store /env/ +/.env/ /__pycache__/ */__pycache__/ mount/ diff --git a/Makefile b/Makefile index 021ccb9a..1ed46262 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,8 @@ ISORT_FLAGS += --recursive codegra_fs TEST_FILE ?= test/ TEST_FLAGS += -vvv -ENV = . env/bin/activate; +ENV_LOC = .env/ +ENV = . $(ENV_LOC)/bin/activate; VERSION = $(shell node -e 'console.log(require("./package.json").version)') UNAME = $(shell uname | tr A-Z a-z) @@ -16,14 +17,14 @@ run: install $(ENV) npm run dev env: - virtualenv --python=python3 env + python3 -m venv $(ENV_LOC) .PHONY: install-deps -install-deps: env/.install-deps env/.install-deps-$(UNAME) node_modules/.install-deps -env/.install-deps: requirements.txt | env +install-deps: $(ENV_LOC)/.install-deps $(ENV_LOC)/.install-deps-$(UNAME) node_modules/.install-deps +$(ENV_LOC)/.install-deps: requirements.txt | env $(ENV) pip3 install -r $^ date >$@ -env/.install-deps-$(UNAME): requirements-$(UNAME).txt | env +$(ENV_LOC)/.install-deps-$(UNAME): requirements-$(UNAME).txt | env $(ENV) pip3 install -r $^ date >$@ node_modules/.install-deps: package.json From 003bc40a5808b017c93373f95e8de4d922e87092 Mon Sep 17 00:00:00 2001 From: Thomas Schaper Date: Mon, 18 Jan 2021 12:02:36 +0100 Subject: [PATCH 04/11] Download macfuse if it doesn't exist --- .github/workflows/mac.yml | 3 ++- .scripts/get_macfuse.bash | 21 +++++++++++++++++++++ Makefile | 5 +---- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .scripts/get_macfuse.bash diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index ccb8ad1f..92729ee5 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -18,7 +18,8 @@ jobs: with: python-version: 3.6 - - uses: actions/setup-node@v2 + - name: Install node + uses: actions/setup-node@v2 with: node-version: '12' diff --git a/.scripts/get_macfuse.bash b/.scripts/get_macfuse.bash new file mode 100644 index 00000000..63e5790e --- /dev/null +++ b/.scripts/get_macfuse.bash @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +cd "$(dirname "$0")/../" || exit 1 + +tmp="$(mktemp -d)" + +function rm_tmp() { + if [[ -n "$tmp" ]]; then + rm -r "$tmp" + fi +} + +trap "rm_tmp" 0 1 2 3 13 15 # EXIT HUP INT QUIT PIPE TERM + +wget https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.0.5/macfuse-4.0.5.dmg \ + -O "$tmp/fuse.dmg" +hdiutil attach -mountpoint "$tmp/mnt" "$tmp/fuse.dmg" +cp "$tmp"/mnt/*.pkg build/pkg-scripts/osxfuse.pkg +hdiutil detach "$tmp/mnt" diff --git a/Makefile b/Makefile index 1ed46262..d2c53fb9 100644 --- a/Makefile +++ b/Makefile @@ -112,10 +112,7 @@ dist/CodeGrade\ Filesystem\ $(VERSION).pkg: dist/mac | build/pkg-scripts/osxfuse "$@" build/pkg-scripts/osxfuse.pkg: - @printf 'Download the osxfuse dmg from https://osxfuse.github.io/\n' >&2 - @printf 'mount it and copy the .pkg file in it to\n' >&2 - @printf 'build/pkg-scripts/osxfuse.pkg\n' >&2 - exit 1 + bash ./.scripts/get_macfuse.bash .PHONY: dist/mac dist/mac: dist/cgfs dist/cgapi-consumer From e2fb15f58240d9c58439b8251ad4c6f259c9c761 Mon Sep 17 00:00:00 2001 From: Thomas Schaper Date: Mon, 18 Jan 2021 12:24:27 +0100 Subject: [PATCH 05/11] Upload resulting artifact --- .github/workflows/mac.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 92729ee5..11604616 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -25,3 +25,8 @@ jobs: - name: Build binary run: make build-quick + + - uses: actions/upload-artifact@v2 + with: + name: codegrade_fs + path: dist/*.pkg From c15b86ef03fd62e9639cf2eb168621400ce18652 Mon Sep 17 00:00:00 2001 From: Thomas Schaper Date: Mon, 18 Jan 2021 12:49:21 +0100 Subject: [PATCH 06/11] Fix update messages --- codegra_fs/cgfs.py | 2 +- src/renderer/App.vue | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/codegra_fs/cgfs.py b/codegra_fs/cgfs.py index 5f4e2722..fbc9389c 100755 --- a/codegra_fs/cgfs.py +++ b/codegra_fs/cgfs.py @@ -2301,7 +2301,7 @@ def check_version() -> None: 'You are running an outdated version of the CodeGrade' ' Filesystem. Please consider upgrading.\nYou can' ' get the latest version at' - ' https://codegra.de/codegra_fs/latest.' + ' https://www.codegrade.com/download-codegrade-filesystem.' ), ] ) diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 3beba4c3..011424b9 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -7,14 +7,15 @@ - A newer version of the CodeGrade Filesystem is available. You can download the - latest version at + A newer version + of the CodeGrade Filesystem is available. You can download + the latest version at - codegra.de/codegra_fs/latest.