-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from knopki/feat-release-automation
Release automation
- Loading branch information
Showing
18 changed files
with
327 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ ignore = E203,E501,W503 | |
classmethod-decorators = | ||
classmethod | ||
validator | ||
per-file-ignores = | ||
*/__init__.py: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,9 @@ | |
# yamllint disable rule:line-length | ||
name: Lint Code Base | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches-ignore: [master, main] | ||
on: # yamllint disable-line rule:truthy rule:comments | ||
# allow this workflow to be called from other workflows | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
|
@@ -18,56 +17,38 @@ jobs: | |
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
if: ${{ !env.ACT }} # skip during local actions testing | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch git base ref | ||
run: | | ||
git fetch --depth=1 \ | ||
origin +${{ github.base_ref || github.event.repository.default_branch }} | ||
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | ||
|
||
- name: npm cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('.github/workflows/linter.yml') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install node tools | ||
run: npm i --silent -g [email protected] | ||
|
||
- uses: mfinelli/setup-shfmt@v2 | ||
with: | ||
shfmt-version: 3.5.0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
cache-dependency-path: | | ||
pyproject.toml | ||
cache-dependency-path: pyproject.toml | ||
|
||
- name: Install pip deps | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[lint] | ||
- name: pre-commit cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
restore-keys: | | ||
pre-commit-${{ env.pythonLocation }}- | ||
- name: Autoflake | ||
run: autoflake -c -r yascheduler | ||
|
||
- name: Black | ||
run: black --check --diff yascheduler | ||
|
||
- name: Run pre-commit | ||
- name: isort | ||
run: isort -c --diff **/*.py | ||
|
||
- name: flake8 | ||
run: | | ||
git branch | ||
pre-commit run --show-diff-on-failure --color=always \ | ||
--from-ref ${{ format('remotes/origin/{0}', github.base_ref || github.event.repository.default_branch) }} \ | ||
--to-ref ${{ github.sha }} | ||
flake8 yascheduler | ||
- name: pylint | ||
# only errors now | ||
run: pylint -E yascheduler | ||
|
||
- name: pyupgrade | ||
run: pyupgrade --py38-plus --keep-percent-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
# yamllint disable rule:line-length | ||
name: PR action | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
lint: | ||
uses: ./.github/workflows/linter.yml | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
if: ${{ !env.ACT }} # skip during local actions testing | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[release] | ||
- name: Build | ||
run: flit build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
# yamllint disable rule:line-length | ||
name: Push action | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
release: | ||
name: Bump version and create draft release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
concurrency: | ||
group: release | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
if: ${{ !env.ACT }} # skip during local actions testing | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[release] | ||
- name: Create bump and changelog | ||
id: cz | ||
if: github.repository == 'tilde-lab/yascheduler' | ||
uses: commitizen-tools/commitizen-action@e41bf7f2029bc8175af362badd6fd0860a329b0f | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
changelog_increment_filename: .CHANGELOG-CURRENT.md | ||
push: true | ||
commit: true | ||
|
||
- name: Print new version | ||
if: github.repository == 'tilde-lab/yascheduler' | ||
run: echo "Bumped to version ${{ steps.cz.outputs.version }}" | ||
|
||
- name: Build | ||
run: flit build | ||
|
||
- name: Stop if no bump | ||
id: no-bump | ||
continue-on-error: true | ||
# will fail if not on exact tag | ||
run: git describe --tags --exact-match | ||
|
||
- name: Create Release Draft | ||
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | ||
if: steps.no-bump.outcome == 'success' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
draft: true | ||
tag_name: v${{ steps.cz.outputs.version }} | ||
body_path: .CHANGELOG-CURRENT.md | ||
fail_on_unmatched_files: true | ||
files: dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# yamllint disable rule:line-length | ||
name: Publish release to pypi | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
pypi: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: release | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
if: ${{ !env.ACT }} # skip during local actions testing | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[release] | ||
- name: Build | ||
run: flit build | ||
|
||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright © 2019-2023 Tilde Materials Informatics | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi" | |
|
||
[project] | ||
name = "yascheduler" | ||
version = "1.0.11" | ||
version = "1.0.12" | ||
description = """Yet another computing scheduler and cloud orchestration engine""" | ||
authors = [ | ||
{name = "Evgeny Blokhin", email = "[email protected]"}, | ||
|
@@ -54,7 +54,6 @@ lint = [ | |
"flake8", | ||
"flake8-bugbear", | ||
"isort", | ||
"pre-commit", | ||
"pylint", | ||
"pylint-per-file-ignores >= 1", | ||
"pyupgrade", | ||
|
Oops, something went wrong.