initial NearBeach
This commit is contained in:
8
NearBeach/.github/FUNDING.yml
vendored
Normal file
8
NearBeach/.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: NearBeach # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: NearBeach
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
custom: # Replace with a single custom sponsorship URL
|
||||
38
NearBeach/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
NearBeach/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Navigate the menu MENU -> SUB MENU
|
||||
3. Click on '....'
|
||||
4. Scroll down to '....'
|
||||
5. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Actual Results**
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
17
NearBeach/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
17
NearBeach/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**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.
|
||||
32
NearBeach/.github/deployment_files/generate_templates.py
vendored
Normal file
32
NearBeach/.github/deployment_files/generate_templates.py
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
from string import Template
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
# Get the latest version from Github
|
||||
results = requests.get("https://api.github.com/repos/NearBeach/NearBeach/releases?page=1&per_page=1")
|
||||
results_json = results.json()
|
||||
|
||||
# Using the results, find the tag name (aka version)
|
||||
version = results_json[0]['tag_name']
|
||||
|
||||
# Create the __init__.py file
|
||||
with open('./.github/deployment_files/template__init__.txt', 'r') as input_file:
|
||||
src = Template(input_file.read())
|
||||
result = src.substitute({'version': version})
|
||||
input_file.close()
|
||||
|
||||
with open('./NearBeach/__init__.py', 'w') as output_file:
|
||||
output_file.write(result)
|
||||
output_file.close()
|
||||
|
||||
# Create the pyproject.toml file
|
||||
with open('./.github/deployment_files/template_pyproject.toml', 'r') as input_file:
|
||||
src = Template(input_file.read())
|
||||
result = src.substitute({'version': version})
|
||||
input_file.close()
|
||||
|
||||
with open('./pyproject.toml', 'w') as output_file:
|
||||
output_file.write(result)
|
||||
output_file.close()
|
||||
|
||||
2
NearBeach/.github/deployment_files/template__init__.txt
vendored
Normal file
2
NearBeach/.github/deployment_files/template__init__.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
name = "NearBeach"
|
||||
__version__ = "$version"
|
||||
60
NearBeach/.github/deployment_files/template_pyproject.toml
vendored
Normal file
60
NearBeach/.github/deployment_files/template_pyproject.toml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "NearBeach"
|
||||
version = "$version"
|
||||
dependencies = [
|
||||
"Django>=4.2.17",
|
||||
"simplejson",
|
||||
"pillow>=10.0.1",
|
||||
"urllib3",
|
||||
"boto3==1.35.99",
|
||||
"azure-storage-blob",
|
||||
"azure-identity",
|
||||
"pip>=19.2",
|
||||
"djangorestframework",
|
||||
"django-two-factor-auth",
|
||||
"django-two-factor-auth[phonenumberslite]",
|
||||
"django_otp",
|
||||
"drf_spectacular",
|
||||
"drf_spectacular[sidecar]"
|
||||
]
|
||||
requires-python = ">=3.10"
|
||||
authors = [
|
||||
{name = "Luke Christopher Clarke", email = "luke@nearbeach.org"},
|
||||
]
|
||||
maintainers = [
|
||||
{name = "Luke Christopher Clarke", email = "luke@nearbeach.org"},
|
||||
]
|
||||
description = "NearBeach - an open source project management tool"
|
||||
readme = "README.md"
|
||||
license = {file = "LICENSE"}
|
||||
keywords = [
|
||||
"project",
|
||||
"task",
|
||||
"project management",
|
||||
"request for change",
|
||||
"open source"
|
||||
]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Operating System :: OS Independent",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"black",
|
||||
"bandit",
|
||||
"python-dotenv",
|
||||
"django-storages",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://nearbeach.org"
|
||||
Documentation = "https://nearbeach.readthedocs.org"
|
||||
Repository = "https://github.com/NearBeach/NearBeach.git"
|
||||
"Bug Tracker" = "https://nearbeach.youtrack.cloud"
|
||||
84
NearBeach/.github/workflows/deploy-nearbeach.yml
vendored
Normal file
84
NearBeach/.github/workflows/deploy-nearbeach.yml
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
name: Deploy NearBeach
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-nearbeach:
|
||||
runs-on: ubuntu-latest
|
||||
environment: main
|
||||
permissions:
|
||||
# IMPORTANT: this permission is mandatory for trusted publishing
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.13.1
|
||||
- name: Update Pip and Install Required Python Libraries
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install virtualenv
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install requests setuptools wheel build
|
||||
pip install --upgrade build
|
||||
- name: Create __init__.py and PyProject.toml files
|
||||
run: |
|
||||
source ./venv/bin/activate
|
||||
python3 ./.github/deployment_files/generate_templates.py
|
||||
- name: Build Package
|
||||
run: |
|
||||
source ./venv/bin/activate
|
||||
python3 -m build
|
||||
- name: Publish package distributions to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
|
||||
deploy-static-files:
|
||||
needs: deploy-nearbeach
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.12.1
|
||||
- name: Create __init__.py and PyProject.toml files
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install virtualenv
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install requests drf-spectacular drf-spectacular[sidecar] django-rest-knox
|
||||
python3 ./.github/deployment_files/generate_templates.py
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
source ./venv/bin/activate
|
||||
pip install --editable .[dev]
|
||||
- name: Collect Static files
|
||||
env:
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_STORAGE_BUCKET_NAME: ${{ secrets.AWS_STORAGE_BUCKET_NAME }}
|
||||
run: |
|
||||
source ./venv/bin/activate
|
||||
python manage.py collectstatic --noinput
|
||||
|
||||
trigger-docker-build:
|
||||
needs: [deploy-static-files, deploy-nearbeach]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Curl to trigger docker deployment
|
||||
run: |
|
||||
curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.BEARER_TOKEN_FOR_GITHUB_ACTIONS }}" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/NearBeach/nearbeach-docker/dispatches \
|
||||
-d '{"event_type":"deploy_nearbeach","client_payload":{"version":"${{ github.ref_name }}"}}'
|
||||
38
NearBeach/.github/workflows/deploy-swagger.yml
vendored
Normal file
38
NearBeach/.github/workflows/deploy-swagger.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Build Swagger and Deploy to Azure Static Web App
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop # or your deployment branch
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-swagger:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 🧾 Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 🐍 Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11' # Match your dev env
|
||||
|
||||
- name: 📦 Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install django django-rest-framework simplejson pillow drf-spectacular drf-spectacular[sidecar] python-dotenv django_otp django-two-factor-auth django-two-factor-auth[phonenumberslite] azure-storage-blob azure-identity botocore boto3 django-rest-knox
|
||||
|
||||
- name: 🔧 Generate Swagger Schema
|
||||
run: |
|
||||
python manage.py spectacular --file swagger/swagger.json
|
||||
|
||||
- name: 🚀 Deploy to Azure Static Web Apps
|
||||
uses: Azure/static-web-apps-deploy@v1
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
|
||||
action: "upload"
|
||||
skip_app_build: true
|
||||
app_location: "swagger"
|
||||
output_location: "swagger.json"
|
||||
Reference in New Issue
Block a user