Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create release config #6

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
branches:
- main
tags:
- v*
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python "3.11"
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Lint with lintrunner
uses: justinchuby/lintrunner-action@main

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Python build dependencies
run: |
python -m pip install --upgrade pip build wheel
- name: Build wheels
run: |
python -m build
- name: Upload wheels
uses: actions/upload-artifact@v3
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
name: dist
path: dist

release:
name: Release
environment: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [build, lint]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@f5622bde02b04381239da3573277701ceca8f6a0
56 changes: 56 additions & 0 deletions .lintrunner.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
merge_base_with = 'main'

[[linter]]
code = 'RUFF'
include_patterns = [
'**/*.py',
'**/*.pyi',
]
exclude_patterns = []
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'ruff_linter',
'--config=pyproject.toml',
'--show-disable',
'@{{PATHSFILE}}',
]
init_command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'ruff==0.4.4',
]
is_formatter = true

[[linter]]
code = 'RUFF-FORMAT'
include_patterns = [
'**/*.py',
]
exclude_patterns = []
command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'ruff_format_linter',
'--config=pyproject.toml',
'--',
'@{{PATHSFILE}}',
]
init_command = [
'python',
'-m',
'lintrunner_adapters',
'run',
'pip_init',
'--dry-run={{DRYRUN}}',
'ruff==0.4.4',
]
is_formatter = true
Loading