From 430fbafc02fa7e54d03b82bff57f768b2df3bc9d Mon Sep 17 00:00:00 2001 From: Peter Gorniak Date: Tue, 12 Jan 2021 13:03:33 -0800 Subject: [PATCH] GitHub actions (#331) * switch github actions --- .github/workflows/compile_card_db.yml | 31 +++++++++++++++++++++++++++ .github/workflows/lint_and_test.yml | 18 ++++++++++++++++ .github/workflows/publish.yml | 26 ++++++++++++++++++++++ .travis.yml | 12 ----------- 4 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/compile_card_db.yml create mode 100644 .github/workflows/lint_and_test.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/compile_card_db.yml b/.github/workflows/compile_card_db.yml new file mode 100644 index 0000000..20d4dc9 --- /dev/null +++ b/.github/workflows/compile_card_db.yml @@ -0,0 +1,31 @@ +name: Compile Card DB + +on: push + +jobs: + compile_card_db: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - run: | + pip install -r requirements.txt + pip install . + - name: Update Languages + run: doit update_languages + - uses: dorny/paths-filter@v2 + id: filter + with: + base: HEAD + filters: | + cardb_target: + - src/domdiv/card_db/** + - name: Commit Results + if: steps.filter.outputs.cardb_target == 'true' + run: | + git config --global user.name 'Github Action: Compile Card DB' + git config --global user.email 'sumpfork@users.noreply.github.com' + git commit -am "Compile Card DB" + git push diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml new file mode 100644 index 0000000..9e8350f --- /dev/null +++ b/.github/workflows/lint_and_test.yml @@ -0,0 +1,18 @@ +name: Lint and Test + +on: push + +jobs: + lint_and_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - run: | + pip install -r requirements.txt + - name: Lint + run: pre-commit run --all-files + - name: Test + run: python setup.py test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..87b8583 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.travis.yml b/.travis.yml index 582cdae..02306e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,24 +2,12 @@ language: python python: - '3.8' install: -- python setup.py install_egg_info - pip install -U setuptools - pip install -r requirements.txt - pip install . script: - python setup.py test - if [[ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ]]; then pre-commit run --all-files; fi -- doit update_languages -after_success: -- git diff -- git status -- git diff-index HEAD -- -- if ! git diff-index --quiet HEAD --; then .travis/push.sh; fi -- echo $TRAVIS_TAG -- git clean -df -- git diff-index HEAD -- -- git diff -- git status deploy: provider: pypi user: __token__