Skip to content

Fix: Coba Deploy ke TestPyPI #21

Fix: Coba Deploy ke TestPyPI

Fix: Coba Deploy ke TestPyPI #21

Workflow file for this run

# This file is part of DataSae and is released under
# the AGPL-3.0-only License: https://opensource.org/license/agpl-v3/
name: Python Application
on: [pull_request, push]
jobs:
lint:
name: Linter Test
runs-on: ubuntu-latest
container:
image: pipelinecomponents/flake8
steps:
- uses: actions/checkout@v3
- name: Lint with flake8
run: flake8
unittest:
name: Unit Test
if: github.event_name == 'pull_request' || contains('refs/heads/main refs/heads/develop', github.ref)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: '3.7'
- name: Install dependencies
run: pip install .
- name: Test
run: python -m unittest
build:
name: Build Python Package
if: always()
needs: [lint, unittest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: '3.7'
- name: Install dependencies
run: pip install build
- name: Restore cache
uses: actions/cache/restore@v3
with:
path: dist/
key: package-dir
- name: Build package
run: python -m build
- name: Save cache
uses: actions/cache/save@v3
with:
path: dist/
key: package-dir
publish:
name: Publish Package to TestPyPI
if: always()
needs: build
runs-on: ubuntu-latest
steps:
- name: Restore cache package
uses: actions/cache/restore@v3
with:
path: dist/
key: package-dir
- name: Publish package
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
skip-existing: true