Skip to content

Commit

Permalink
Adjust action temp
Browse files Browse the repository at this point in the history
  • Loading branch information
dynobo committed Jun 25, 2022
1 parent 87086aa commit c02813a
Showing 1 changed file with 3 additions and 78 deletions.
81 changes: 3 additions & 78 deletions .github/workflows/python.yaml
Expand Up @@ -9,11 +9,6 @@ jobs:
test:
name: Linting & Tests
runs-on: ${{ matrix.os }}
if: |
github.event_name == 'pull_request'
|| contains(github.event.head_commit.message, '[test]')
|| startsWith(github.ref, 'refs/tags/v')
|| startsWith(github.ref, 'refs/heads/dev')
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -98,12 +93,6 @@ jobs:
- name: Pydocstyle
if: always()
run: poetry run pydocstyle
- name: Safety
if: always()
run: poetry run safety check
- name: Bandit
if: always()
run: poetry run bandit --quiet --severity-level medium -r src/normcap
- name: Pytest
run: |
poetry run pytest -m "not skip_on_gh" --log-cli-level=10 --cov --cov-report=xml
Expand All @@ -116,61 +105,8 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}

- name: SonarCloud
if:
${{ matrix.os == 'ubuntu-20.04' && github.repository
=='dynobo/normcap' }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# Build test package
- name: Install briefcase and run build
shell: bash -l {0}
run: |
poetry run python build.py dev
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV

# Release test package
- name: Draft internal release
uses: ncipollo/release-action@v1
if: ${{ github.repository == 'dynobo/normcap' }}
with:
name: Internal
body:
"Only for internal tests. Should not be published. [${{ env.NOW }}]"
artifacts: "*/*.+(dmg|AppImage|msi)"
artifactErrorsFailBuild: false
allowUpdates: true
draft: true
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
tag: "internal"

build-python:
name: Build and release new Python package
needs: test
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: abatilo/actions-poetry@v2.1.4
with:
poetry-version: 1.1.12
- name: Poetry publish
run: |
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
build-packages:
name: Build and release packages
needs: test
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -205,18 +141,7 @@ jobs:
artifactErrorsFailBuild: false
allowUpdates: true
draft: true
prerelease: ${{ steps.extract_version.outputs.PRE_RELEASE != ''}}
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}

deploy-pages:
name: Deploy github pages
needs: build-packages
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Deploy pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
name: v0.3.4
tag: v0.3.4

0 comments on commit c02813a

Please sign in to comment.