Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed May 9, 2021
1 parent 0e60875 commit c61e687
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 25 deletions.
86 changes: 62 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,87 @@ on:
- master

env:
PROJECT_FOLDER: "qgis_plugin_repo"
# PROJECT_FOLDER: "qgis_plugin_repo"
PYTHON_VERSION: 3.8

jobs:
# tests:
# name: "Tests"
# runs-on: ubuntu-latest
#
# steps:
# - name: Get source code
# uses: actions/checkout@v2
#
# - name: Set up Python
# uses: actions/setup-python@v1
# with:
# python-version: ${{ env.PYTHON_VERSION }}
#
# - name: Install Python requirements
# run: python -m pip install -U pip setuptools wheel
#
tests:
name: "Tests"
runs-on: ubuntu-latest

steps:
- name: Get source code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Python requirements
run: python -m pip install -U pip setuptools wheel

- name: Debug
run: ls -la

# - name: Run tests
# working-directory: tests
# run: python -m unittest

release:
name: "Release on tag 🚀"
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [tests]

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')

steps:
- name: Get source code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup
run: |
VERSION=${GITHUB_REF:-0.0.0}
VERSION=${VERSION##*/}
sed "s/__VERSION__/${VERSION}/" setup.py > setup.py
sed -i "s/__VERSION__/${VERSION}/g" setup.py
- name: Build package
run: |
python setup.py sdist
- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@master
- name: Debug
run: |
ls -al dist
- name: Create release on GitHub
id: create_release
uses: ncipollo/release-action@v1.8.4
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
artifacts: "dist/*.tar.gz"
# tag_name: ${{ github.ref }}
# release_name: ${{ github.ref }}
# body_path: release.md

# - name: Deploy to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}

#
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./my-artifact.zip
# asset_name: my-artifact.zip
# asset_content_type: application/zip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.idea/

# Python
build/
dist/
__pycache__/
*.egg-info
.venv
Expand Down
14 changes: 14 additions & 0 deletions dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:

# - package-ecosystem: pip
# directory: "/requirements"
# schedule:
# interval: monthly
# time: "04:00"
# timezone: Europe/Paris

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"Intended Audience :: Information Technology",
],
install_requires=["requests"],
extra_require=dict(tests=['pytest']),
# extra_require=dict(tests=['pytest']),
python_requires=">={vmaj}.{vmin}".format(
vmaj=python_min_version[0], vmin=python_min_version[1]
),
Expand Down

0 comments on commit c61e687

Please sign in to comment.