Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yjmm10 committed Aug 13, 2024
1 parent fda7cc3 commit 8ed2cbe
Showing 1 changed file with 53 additions and 23 deletions.
76 changes: 53 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: master
name: Telos CI/CD

on:
push:
branches:
- master
- develop
tags:
- "*"

- "v*"
pull_request:
branches:
- master
Expand All @@ -19,14 +15,12 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.10"]


steps:
- uses: actions/checkout@v3
with:
Expand All @@ -36,10 +30,16 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Install Git LFS
if: runner.os != 'Windows'
run: |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
- name: Install Git LFS (Windows)
if: runner.os == 'Windows'
run: |
choco install git-lfs
git lfs install
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -50,7 +50,7 @@ jobs:
- name: Download models
run: |
git clone https://huggingface.co/liferecors/Telos.git telos/models
- name: test
- name: Run tests
run: |
tox -e py
Expand All @@ -66,19 +66,11 @@ jobs:
tox -e isort
tox -e pylint
deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'Telos'

build:
needs: [test, linting]
runs-on: ubuntu-latest

needs:
- test
- linting

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -88,9 +80,47 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade poetry
- name: Build package
run: |
poetry build
- name: Publish a Python distribution to PyPI
run: poetry build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dist
path: dist

publish:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

create-release:
needs: publish
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

0 comments on commit 8ed2cbe

Please sign in to comment.