Skip to content

Commit

Permalink
chore: GitHub workflow to publish pushes on main branch to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Feb 11, 2024
1 parent 7b7fc0b commit 2339b96
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 70 deletions.
124 changes: 124 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

env:
PYTHON_VERSION: '3.11'

jobs:
integration:
name: Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout

- uses: actions/setup-python@v5
name: Setup Python
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-0

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true

- name: Install dependencies
run: poetry install --extras=dev --with dev

- name: Lint
run: poetry run poe lint

- name: Create stub files
run: poetry run pyright --createstub kivy

- name: Type Check
run: poetry run poe typecheck

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout

- uses: actions/setup-python@v5
name: Setup Python
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-0

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true

- name: Install dependencies
run: poetry install

- name: Build
run: poetry build

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel
path: dist/*.whl
if-no-files-found: error

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: binary
path: dist/*.tar.gz
if-no-files-found: error

pypi-publish:
name: Publish to PyPI
if: >-
github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
- integration
- build
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/ubo-app
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: wheel
path: dist

- uses: actions/download-artifact@v4
with:
name: binary
path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
verbose: true
69 changes: 0 additions & 69 deletions .github/workflows/integration.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.10.1

- chore: GitHub workflow to publish pushes on `main` branch to PyPI

## Version 0.10.0

- chore: add integration GitHub workflow to check lint, typing and build issues
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ubo-app"
version = "0.10.0"
version = "0.10.1"
description = "Ubo main app, running on device initialization. A platform for running other apps."
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 2339b96

Please sign in to comment.