-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pull request and main branch workflow
- Loading branch information
1 parent
3ee87d5
commit 4cb7ae2
Showing
2 changed files
with
122 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
name: Main branch workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
runs-on: [ubuntu-latest] | ||
outputs: | ||
project_version: ${{ steps.get_project_version.outputs.project_version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.11' | ||
- name: Get a project version | ||
id: get_project_version | ||
run: echo "::set-output name=project_version::$(make get-project-version)" | ||
- name: Install project requirements | ||
run: make install-requirements | ||
- name: Make a release | ||
env: | ||
ACCESS_TOKEN: ${{secrets.GIT_HUB_ACCESS_TOKEN}} | ||
run: | | ||
project-version release \ | ||
--provider=GitHub \ | ||
--organization=dmytrostriletskyi \ | ||
--repository=intentions \ | ||
--branch=main \ | ||
--project-version=${{ steps.get_project_version.outputs.project_version }} | ||
deploy: | ||
runs-on: [ubuntu-latest] | ||
needs: [release] | ||
outputs: | ||
project_version: ${{ steps.get_project_version.outputs.project_version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.11' | ||
- name: Get a project version | ||
id: get_project_version | ||
run: echo "::set-output name=project_version::$(make get-project-version)" | ||
- name: Install project requirements | ||
run: make install-requirements | ||
- name: Build the package | ||
run: python3 setup.py sdist | ||
- name: Deploy the package | ||
run: | | ||
twine upload \ | ||
--username ${{ secrets.PYPI_USERNAME }} \ | ||
--password ${{ secrets.PYPI_PASSWORD }} \ | ||
dist/intentions-${{ steps.get_project_version.outputs.project_version }}.tar.gz |
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,64 @@ | ||
--- | ||
name: Pull request workflow | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-project-version: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ['3.11'] | ||
outputs: | ||
project_version: ${{ steps.get_project_version.outputs.project_version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Get a version of the project | ||
id: get_project_version | ||
run: echo "::set-output name=project_version::$(make get-project-version)" | ||
- name: Install project requirements | ||
run: make install-requirements | ||
- name: Check project version | ||
env: | ||
ACCESS_TOKEN: ${{secrets.GIT_HUB_ACCESS_TOKEN}} | ||
run: | | ||
project-version check \ | ||
--provider=GitHub \ | ||
--organization=dmytrostriletskyi \ | ||
--repository=intentions \ | ||
--base-branch=main \ | ||
--head-branch=${{ github.head_ref }} | ||
lint: | ||
name: Lint the codebase (python-${{ matrix.python-version }} on ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ['3.11'] | ||
outputs: | ||
project_version: ${{ steps.get_project_version.outputs.project_version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Get a version of the project | ||
id: get_project_version | ||
run: echo "::set-output name=project_version::$(make get-project-version)" | ||
- name: Install project requirements | ||
run: make install-requirements | ||
- name: Check code quality | ||
run: make check-code-quality |