-
Notifications
You must be signed in to change notification settings - Fork 1
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 #4 from DigitalGeographyLab/3-gh-actions
GH action workflows
- Loading branch information
Showing
16 changed files
with
289 additions
and
242 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,29 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Environment:** | ||
- OS: | ||
- Python package source (PyPi, conda, ...) | ||
- Versions of Python, Java Development Kit, Python modules | ||
|
||
**Additional context** | ||
Add any other context about the problem here. | ||
|
||
**Test data and/or script/notebook** | ||
If you have a reproducible example case, including test data or a snippet of code, please attach them to this issue. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,33 @@ | ||
# vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab: | ||
|
||
name: Build main branch | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [closed] | ||
push: | ||
branches: [main] | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Build wheel(s) and packages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
- name: Install build tools | ||
run: python -m pip install build | ||
- name: Build wheel(s) and packages | ||
run: python -m build . | ||
- name: Upload built packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: package | ||
path: 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,19 @@ | ||
# vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab: | ||
|
||
name: Lint code of pull requests | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Linting code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
- run: pip install black flake8 | ||
- run: python -m black --check . | ||
- run: python -m flake8 . |
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,86 @@ | ||
# vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab: | ||
|
||
name: Create a release and deploy to PyPi whenever a protected tag (v0.0.0) is created | ||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
jobs: | ||
build: | ||
name: Build package | ||
uses: ./.github/workflows/build.yml | ||
secrets: inherit | ||
|
||
merge-into-stable: | ||
name: Update stable branch to point to this release | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: "!contains(github.ref, 'dev')" | ||
permissions: write-all | ||
steps: | ||
- name: Clone repository, check-out stable | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: stable | ||
- name: Merge tag into stable | ||
run: | | ||
TAG="${{github.ref}}" # /ref/tags/v0.0.0 | ||
git merge "${TAG:10}" | ||
git push | ||
deploy: | ||
name: Upload built package to PyPi | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Download built artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: package | ||
path: dist/ | ||
- name: Upload package to PyPi | ||
uses: pypa/gh-action-pypi-publish@release/v1.5 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip_existing: true | ||
|
||
release: | ||
name: Create a new release | ||
runs-on: ubuntu-latest | ||
needs: [deploy] | ||
if: "!contains(github.ref, 'dev')" | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download built artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: package | ||
path: dist/ | ||
- name: Create release and upload package | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/* | ||
|
||
prerelease: | ||
name: Create a new pre-release | ||
runs-on: ubuntu-latest | ||
needs: [deploy] | ||
if: contains(github.ref, 'dev') | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download built artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: package | ||
path: dist/ | ||
- name: Create release and upload package | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/* | ||
prerelease: true |
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
Oops, something went wrong.