diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e56a83b..c7ff29f 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -12,23 +12,23 @@ jobs: python-version: [3.5, 3.6, 3.7] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + python3 -m pip install --upgrade pip + python3 -m pip install -r requirements.txt - name: Lint with flake8 run: | - pip install flake8 + python3 -m pip install flake8 # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --ignore=D203,D100,D103,D202,D200,W504 --max-complexity=10 --max-line-length=120 --statistics - name: Test with pytest run: | - pip install pytest + python3 -m pip install pytest pytest --tb native -ra -v -s diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 980c75b..8dfc1aa 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -9,15 +9,14 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 with: python-version: '3.6' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + python3 -m pip install --upgrade pip + python3 -m pip install setuptools wheel twine - name: Build run: python setup.py sdist bdist_wheel - name: Publish diff --git a/.github/workflows/snappublish.yml b/.github/workflows/snappublish.yml new file mode 100644 index 0000000..5432f46 --- /dev/null +++ b/.github/workflows/snappublish.yml @@ -0,0 +1,52 @@ +name: Upload Snap Package + +on: push +# on: +# create: +# tags: +# - refs/tags/* + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Set up lxd + run: | + sudo usermod --append --groups lxd $(whoami) + sudo su $(whoami) -c 'lxd init --auto' + sudo su $(whoami) -c 'lxc network set lxdbr0 ipv6.address none' + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install tox + - name: Render snapcraft config + run: | + export SNAPCRAFT_PROJECT_VERSION=$(cat VERSION) + envsubst < snap/snapcraft.yaml.tpl > snap/snapcraft.yaml + rm snap/snapcraft.yaml.tpl + - name: Build snap + run: | + sg lxd -c 'snapcraft --use-lxd' + + - uses: actions/upload-artifact@v2 + with: + name: jujuna + path: | + jujuna*.snap + + # https://circleci.com/docs/2.0/build-publish-snap-packages/ + # - name: Publish snap + # env: + # SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_TOKEN }} + # run: | + # mkdir .snapcraft + # echo $SNAPCRAFT_LOGIN_FILE | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg + # snapcraft push *.snap --release edge + # # [[ "${GITHUB_REF}" =~ refs/tags/$(cat VERSION) ]] && snapcraft push *.snap --release edge || echo "not publishing" + # shell: bash diff --git a/.gitignore b/.gitignore index 8675149..e4cf782 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ +snap/snapcraft.yaml + .vagrant vagrant.retry @@ -104,4 +106,4 @@ venv.bak/ .DS_Store # Snapcraft -*.snap \ No newline at end of file +*.snap diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index df5920d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: python -sudo: false -matrix: - include: - - python: "3.5" - dist: xenial - - python: "3.6" - dist: xenial - env: BUILD_SNAP=true - - python: "3.7" - dist: bionic -install: - - pip install -q pytest flake8 pip>=19 tox-travis - - pip install tox - - if [[ "$BUILD_SNAP" == true ]]; then sudo apt-get install snapcraft; fi -script: - - tox - - tox -e lint - - tox -e docs - - export SNAPCRAFT_PROJECT_VERSION=$(cat VERSION) && envsubst < snap/snapcraft.yaml.tpl > snap/snapcraft.yaml - - if [[ "$BUILD_SNAP" == true ]]; then snapcraft; fi -deploy: - provider: snap - snap: jujuna_*_amd64.snap - channel: edge - skip_cleanup: true - on: - branch: master - python: "3.6" diff --git a/VERSION b/VERSION index a45be46..834f262 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.8 +2.8.0 diff --git a/setup.py b/setup.py index 9ff6e60..86710f0 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,8 @@ "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Environment :: Console" diff --git a/snap/snapcraft.yaml.tpl b/snap/snapcraft.yaml.tpl index d704877..d00b39f 100644 --- a/snap/snapcraft.yaml.tpl +++ b/snap/snapcraft.yaml.tpl @@ -1,5 +1,5 @@ name: jujuna -base: core18 +base: core20 version: "${SNAPCRAFT_PROJECT_VERSION}" summary: Jujuna, continuous deployment, upgrade and testing for Juju. description: | @@ -11,8 +11,8 @@ confinement: strict parts: jujuna: plugin: python - python-version: python3 - requirements: ./requirements.txt + requirements: + - ./requirements.txt source: . apps: jujuna: