Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump axios from 0.18.0 to 0.21.1 #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Always use lf lineendings
* text=auto

# Always use lf lineendings for py, js, and vue files
*.js text eol=lf
*.vue text eol=lf
*.py text eol=lf
97 changes: 97 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
name: "Build and deploy"

"on":
push:
branches:
- feature/gh-actions-mac
- release/*

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-2019
- macos-10.15
- ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: '12'

- name: Setup Python for Ubuntu
run: |
sudo apt-get install -y \
python3 python3-dev python3-pip python3-venv python3-all \
dh-python debhelper devscripts dput software-properties-common \
python3-distutils python3-setuptools python3-wheel python3-stdeb
if: startsWith(matrix.os, 'ubuntu')

- name: Build binary for Ubuntu
run: |
python3 -m venv env
source env/bin/activate
make build-quick
if: startsWith(matrix.os, 'ubuntu')

- name: Setup Python for not Ubuntu
uses: actions/setup-python@v2
with:
python-version: 3.6
if: startsWith(matrix.os, 'ubuntu') == false

- name: Build binary for not Ubuntu
run: make build-quick
if: startsWith(matrix.os, 'ubuntu') == false

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: |
dist/*.pkg
dist/*.exe
dist/install_linux.bash
dist/*.deb
if-no-files-found: error
retention-days: 1

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_S3_FS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_FS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: ./dist

- name: Set version
run: |
echo "VERSION=v$(jq --raw-output .version < package.json)" >> $GITHUB_ENV
echo "S3_CP=aws s3 cp --acl public-read" >> $GITHUB_ENV
echo "S3_SYNC=aws s3 sync --acl public-read" >> $GITHUB_ENV

- name: Upload fs to S3
run: |
$S3_CP dist/ubuntu*/install_linux.bash s3://codegradefs/$VERSION/install_linux.bash
$S3_CP dist/ubuntu*/python3-fusepy*.deb s3://codegradefs/$VERSION/linux/python3-fusepy.deb
$S3_CP dist/ubuntu*/python3-codegrade-fs*_all.deb s3://codegradefs/$VERSION/linux/python3-codegrade-fs_all.deb
$S3_CP dist/ubuntu*/codegrade-fs*_amd64.deb s3://codegradefs/$VERSION/linux/codegrade-fs_amd64.deb
$S3_CP dist/ubuntu*/codegrade-fs*_i386.deb s3://codegradefs/$VERSION/linux/codegrade-fs_i386.deb

$S3_CP dist/windows*/*.exe s3://codegradefs/$VERSION/codegrade_filesystem_installer.exe
$S3_CP dist/mac*/*.pkg s3://codegradefs/$VERSION/codegrade_filesystem_installer.pkg
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
/env/
/.env/
/__pycache__/
*/__pycache__/
mount/
Expand Down
21 changes: 21 additions & 0 deletions .scripts/get_macfuse.bash
Original file line number Diff line number Diff line change
@@ -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"
18 changes: 18 additions & 0 deletions .scripts/get_os.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python
import sys
import platform


def main():
system = platform.system()
if system == 'Windows':
print('win')
elif system in ('Darwin', 'Linux'):
print(system.lower())
else:
print('The system {} is not supported'.format(system), file=sys.stderr)
sys.exit(1)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/usr/bin/env python
import os
import json

BASE = os.path.join(os.path.dirname(__file__), '..')

TEMPLATE = """
#!/bin/bash
# SPDX-License-Identifier: AGPL-3.0-only
VERSION="1.1.2"
BASE_URL="https://fs.codegrade.com/v{{VERSION}}/linux"

err_echo() {
(>&2 echo "$@")
Expand All @@ -20,13 +26,13 @@
}

install_deps() {
sudo apt-get install -qy wget python3 fuse python3-requests libnotify4 gconf2 gconf-service libappindicator1 libxtst6 libnss3
sudo apt-get install -qy wget python3 fuse python3-requests libnotify4 gconf2 gconf-service libappindicator1 libxtst6 libnss3 python3-packaging
}

download_file() {
local url="$1" dst="$2"
if ! wget --quiet "$url" -O "$dst"; then
err_echo "Failed to download file: $url"
err_echo "Failed to download file: ${url}, please check if a new version is available on https://codegrade.com/download-codegrade-filesystem"
exit 10
fi
}
Expand Down Expand Up @@ -63,38 +69,49 @@
echo "Updating package list"
sudo apt update -q

printf "\\nInstalling dependencies\\n"
printf "\\\\nInstalling dependencies\\\\n"
if ! install_deps; then
err_echo "Failed to install dependencies"
exit 4
fi
tmpdir="$(mktemp -d)"
trap '[[ -n $tmpdir ]] && rm -rf "$tmpdir"' 0 1 2 3 15

printf "\\nDownloading all needed files\\n"
download_file "https://codegra.de/static/fs/linux/python3-fusepy_NEWEST-1_all.deb" "$tmpdir/fusepy.deb"
if is_distro "Debian"; then
download_file "https://codegra.de/static/fs/debian/python3-codegrade-fs_${VERSION}-1_all.deb" "$tmpdir/backend.deb"
else
download_file "https://codegra.de/static/fs/ubuntu/python3-codegrade-fs_${VERSION}-1_all.deb" "$tmpdir/backend.deb"
fi
download_file "https://codegra.de/static/fs/linux/codegrade-fs_${VERSION}_$(get_arch).deb" "$tmpdir/frontend.deb"
printf "\\\\nDownloading all needed files\\\\n"
download_file "${BASE_URL}/python3-fusepy.deb" "$tmpdir/fusepy.deb"
download_file "${BASE_URL}/python3-codegrade-fs_all.deb" "$tmpdir/backend.deb"
download_file "${BASE_URL}/codegrade-fs_$(get_arch).deb" "$tmpdir/frontend.deb"

if _pip list | grep -- 'CodeGra.fs'; then
printf "\\nRemoving old versions\\n"
printf "\\\\nRemoving old versions\\\\n"
_pip uninstall -y CodeGra.fs
fi

printf "\\nInstalling our version of fusepy\\n"
printf "\\\\nInstalling our version of fusepy\\\\n"
sudo dpkg -i "$tmpdir/fusepy.deb"
printf "\\nInstalling the backend of the CodeGrade Filesystem\\n"
printf "\\\\nInstalling the backend of the CodeGrade Filesystem\\\\n"
sudo dpkg -i "$tmpdir/backend.deb"
printf "\\nInstalling the frontend of the CodeGrade Filesystem\\n"
printf "\\\\nInstalling the frontend of the CodeGrade Filesystem\\\\n"
sudo dpkg -i "$tmpdir/frontend.deb"
rm -rf "$tmpdir"
tmpdir=""

printf "\\nDone installing the file system\\n"
printf "\\\\nDone installing the file system\\\\n"
}

main
""".lstrip()


def main():
with open(os.path.join(BASE, 'package.json'), 'r') as f:
version = json.load(f)['version']

dist_dir = os.path.join(BASE, 'dist')
os.makedirs(dist_dir, exist_ok=True)
with open(os.path.join(dist_dir, 'install_linux.bash'), 'w') as f:
f.write(TEMPLATE.replace('{{VERSION}}', version))


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include debian/patches/fix-cgfs_types
include debian/patches/fix-fusepy
include debian/patches/series
include package.json
Loading