From 24ceb7d9bc9b725ba89a6a1c6d297da9d22abb79 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Dec 2020 19:43:24 +0100 Subject: [PATCH 1/5] Change CI to use official node installation --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9bf8bd7..06f41ba8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,17 +10,17 @@ on: jobs: build: - runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-18.04] + os: [ ubuntu-20.04] steps: - uses: actions/checkout@v2 - - name: npm install - uses: bahmutov/npm-install@v1 + - uses: actions/setup-node@v2-beta + + - run: yarn install - name: Run Lint run: | From 041333921236f2ecb63e7c1ea7fa1728c5d1cc4f Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Dec 2020 19:52:32 +0100 Subject: [PATCH 2/5] Add artifact upload --- .github/workflows/ci.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06f41ba8..b62dc4cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04] + os: [ ubuntu-20.04 ] steps: - uses: actions/checkout@v2 @@ -23,9 +23,19 @@ jobs: - run: yarn install - name: Run Lint - run: | - yarn lint-ci + run: yarn lint-ci - name: Run Tests - run: | - yarn test:unit + run: yarn test:unit + + - name: Build build + run: yarn build + + - name: Archive production artifacts + uses: actions/upload-artifact@v2 + with: + name: FreqUI-dist + path: | + dist + !dist/**/*.md + retention-days: 10 From 6f3b2a7c398eaa39ab82c3e653fbb96e67686342 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 5 Dec 2020 20:04:09 +0100 Subject: [PATCH 3/5] Exclude map files --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b62dc4cd..40af0389 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,11 +31,11 @@ jobs: - name: Build build run: yarn build - - name: Archive production artifacts + - name: Archive artifacts uses: actions/upload-artifact@v2 with: name: FreqUI-dist path: | dist - !dist/**/*.md + !dist/**/*.map retention-days: 10 From 93fd1ba216657d293b84f47a26469a20bbacb641 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 6 Dec 2020 09:44:58 +0100 Subject: [PATCH 4/5] Remove unneeded log statements --- src/components/BootswatchThemeSelect.vue | 4 +--- src/components/Login.vue | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/BootswatchThemeSelect.vue b/src/components/BootswatchThemeSelect.vue index 9ceb724a..29b7ac40 100644 --- a/src/components/BootswatchThemeSelect.vue +++ b/src/components/BootswatchThemeSelect.vue @@ -139,7 +139,6 @@ export default { return; } if (themeName.toLowerCase() === 'bootstrap') { - console.log('bootstrap'); const styles = document.getElementsByTagName('style'); const bw = Array.from(styles).filter((w) => w.textContent.includes('bootswatch')); // Reset all bootswatch styles @@ -166,7 +165,6 @@ export default { }); } // Save the theme as localstorage - console.log('Setting theme as', themeName); window.localStorage.theme = themeName; this.activeTheme = themeName; }, @@ -187,7 +185,7 @@ export default { // ); }) .catch((error) => { - console.log(error); + console.error(error); }); }, }, diff --git a/src/components/Login.vue b/src/components/Login.vue index 1553b4e4..0d2242d0 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -131,7 +131,6 @@ export default class Login extends Vue { userService .login(this.auth) .then(() => { - console.log('Login success.'); this.setLoggedIn(true); setBaseUrl(userService.getAPIUrl()); this.emitLoginResult(true); @@ -141,7 +140,6 @@ export default class Login extends Vue { if (resolved.route.name !== '404') { this.$router.push(resolved.route.path); } else { - console.log('Invalid redirect detected. Redirecting to home.'); this.$router.push('/'); } } else { @@ -152,7 +150,7 @@ export default class Login extends Vue { .catch((error) => { this.errorMessageCORS = false; // this.nameState = false; - console.log(error.response); + console.error(error.response); if (error.response && error.response.status === 401) { this.nameState = false; this.errorMessage = 'Connected to bot, however Login failed, Username or Password wrong.'; @@ -165,7 +163,7 @@ You can verify this by navigating to ${this.auth.url}/api/v1/ping to make sure t this.errorMessageCORS = true; } } - console.log(this.errorMessage); + console.error(this.errorMessage); this.emitLoginResult(false); }); } From 4cea1cc3f2408de8b35e71db89eb8dca4f7ae1cb Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 6 Dec 2020 10:26:02 +0100 Subject: [PATCH 5/5] Add deploy step --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40af0389..9df7788d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ on: pull_request: branches: - master + release: + types: [ created ] + # types: [published] jobs: build: @@ -34,8 +37,26 @@ jobs: - name: Archive artifacts uses: actions/upload-artifact@v2 with: - name: FreqUI-dist + name: FreqUI path: | dist !dist/**/*.map retention-days: 10 + + deploy: + needs: [ build ] + runs-on: ubuntu-20.04 + if: github.event_name == 'release' + steps: + + - uses: actions/download-artifact@v2 + with: + name: FreqUI + path: ./ + + - name: Upload release binaries + uses: alexellis/upload-assets@0.2.2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + asset_paths: '["FreqUI.zip"]'