From 7dcf36df6dba1f0577a46ca0d0fddf5b839e1569 Mon Sep 17 00:00:00 2001 From: Simon Diesenreiter Date: Sat, 9 Nov 2024 08:22:28 -0800 Subject: [PATCH] some mroe cleanup --- {.github => .gitea}/PULL_REQUEST_TEMPLATE.md | 0 {.github => .gitea}/init.sh | 0 {.github => .gitea}/release_message.sh | 0 {.github => .gitea}/rename_project.sh | 0 {.github => .gitea}/template.yml | 0 {gitea => .gitea}/workflows/main.yml | 0 {.github => .gitea}/workflows/release.yml | 0 .../workflows/rename_project.yml | 0 .github/FUNDING.yml | 12 --- .github/ISSUE_TEMPLATE/bug_report.md | 31 ------- .github/ISSUE_TEMPLATE/feature_request.md | 20 ----- .github/dependabot.yml | 6 -- .github/workflows/main.yml | 88 ------------------- gitea/PULL_REQUEST_TEMPLATE.md | 15 ---- gitea/init.sh | 68 -------------- gitea/release_message.sh | 3 - gitea/rename_project.sh | 36 -------- gitea/template.yml | 1 - gitea/workflows/release.yml | 52 ----------- gitea/workflows/rename_project.yml | 42 --------- 20 files changed, 374 deletions(-) rename {.github => .gitea}/PULL_REQUEST_TEMPLATE.md (100%) rename {.github => .gitea}/init.sh (100%) rename {.github => .gitea}/release_message.sh (100%) rename {.github => .gitea}/rename_project.sh (100%) rename {.github => .gitea}/template.yml (100%) rename {gitea => .gitea}/workflows/main.yml (100%) rename {.github => .gitea}/workflows/release.yml (100%) rename {.github => .gitea}/workflows/rename_project.yml (100%) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/main.yml delete mode 100644 gitea/PULL_REQUEST_TEMPLATE.md delete mode 100755 gitea/init.sh delete mode 100755 gitea/release_message.sh delete mode 100755 gitea/rename_project.sh delete mode 100644 gitea/template.yml delete mode 100644 gitea/workflows/release.yml delete mode 100644 gitea/workflows/rename_project.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.gitea/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE.md rename to .gitea/PULL_REQUEST_TEMPLATE.md diff --git a/.github/init.sh b/.gitea/init.sh similarity index 100% rename from .github/init.sh rename to .gitea/init.sh diff --git a/.github/release_message.sh b/.gitea/release_message.sh similarity index 100% rename from .github/release_message.sh rename to .gitea/release_message.sh diff --git a/.github/rename_project.sh b/.gitea/rename_project.sh similarity index 100% rename from .github/rename_project.sh rename to .gitea/rename_project.sh diff --git a/.github/template.yml b/.gitea/template.yml similarity index 100% rename from .github/template.yml rename to .gitea/template.yml diff --git a/gitea/workflows/main.yml b/.gitea/workflows/main.yml similarity index 100% rename from gitea/workflows/main.yml rename to .gitea/workflows/main.yml diff --git a/.github/workflows/release.yml b/.gitea/workflows/release.yml similarity index 100% rename from .github/workflows/release.yml rename to .gitea/workflows/release.yml diff --git a/.github/workflows/rename_project.yml b/.gitea/workflows/rename_project.yml similarity index 100% rename from .github/workflows/rename_project.yml rename to .gitea/workflows/rename_project.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 1e9d2a1..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [rochacbruno] -patreon: # Replace with a single Patreon username -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 -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 0d9360d..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug, help wanted -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index cc98b69..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement, question -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. diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index c34c3fb..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "gitea-actions" - directory: "/" - schedule: - interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 37da8b2..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,88 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - linter: - strategy: - fail-fast: false - matrix: - python-version: [3.9] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install project - run: make install - - name: Run linter - run: make lint - - tests_linux: - needs: linter - strategy: - fail-fast: false - matrix: - python-version: [3.9] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install project - run: make install - - name: Run tests - run: make test - - # tests_mac: - # needs: linter - # strategy: - # fail-fast: false - # matrix: - # python-version: [3.9] - # os: [macos-latest] - # runs-on: ${{ matrix.os }} - # steps: - # - uses: actions/checkout@v3 - # - uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Install project - # run: make install - # - name: Run tests - # run: make test - - # tests_win: - # needs: linter - # strategy: - # fail-fast: false - # matrix: - # python-version: [3.9] - # os: [windows-latest] - # runs-on: ${{ matrix.os }} - # steps: - # - uses: actions/checkout@v3 - # - uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # - name: Install Pip - # run: pip install --user --upgrade pip - # - name: Install project - # run: pip install -e .[test] - # - name: run tests - # run: pytest -s -vvvv -l --tb=long tests diff --git a/gitea/PULL_REQUEST_TEMPLATE.md b/gitea/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9ccc736..0000000 --- a/gitea/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,15 +0,0 @@ -### Summary :memo: -_Write an overview about it._ - -### Details -_Describe more what you did on changes._ -1. (...) -2. (...) - -### Bugfixes :bug: (delete if dind't have any) -- - -### Checks -- [ ] Closed #798 -- [ ] Tested Changes -- [ ] Stakeholder Approval diff --git a/gitea/init.sh b/gitea/init.sh deleted file mode 100755 index c6b0a55..0000000 --- a/gitea/init.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -overwrite_template_dir=0 - -while getopts t:o flag -do - case "${flag}" in - t) template=${OPTARG};; - o) overwrite_template_dir=1;; - esac -done - -if [ -z "${template}" ]; then - echo "Available templates: flask" - read -p "Enter template name: " template -fi - -repo_urlname=$(basename -s .git `git config --get remote.origin.url`) -repo_name=$(basename -s .git `git config --get remote.origin.url` | tr '-' '_' | tr '[:upper:]' '[:lower:]') -repo_owner=$(git config --get remote.origin.url | awk -F ':' '{print $2}' | awk -F '/' '{print $1}') -echo "Repo name: ${repo_name}" -echo "Repo owner: ${repo_owner}" -echo "Repo urlname: ${repo_urlname}" - -if [ -f ".gitea/workflows/rename_project.yml" ]; then - .gitea/rename_project.sh -a "${repo_owner}" -n "${repo_name}" -u "${repo_urlname}" -d "Awesome ${repo_name} created by ${repo_owner}" -fi - -function download_template { - rm -rf "${template_dir}" - mkdir -p .gitea/templates - git clone "${template_url}" "${template_dir}" -} - -echo "Using template:${template}" -template_url="https://github.com/rochacbruno/${template}-project-template" -template_dir=".gitea/templates/${template}" -if [ -d "${template_dir}" ]; then - # Template directory already exists - if [ "${overwrite_template_dir}" -eq 1 ]; then - # user passed -o flag, delete and re-download - echo "Overwriting ${template_dir}" - download_template - else - # Ask user if they want to overwrite - echo "Directory ${template_dir} already exists." - read -p "Do you want to overwrite it? [y/N] " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Overwriting ${template_dir}" - download_template - else - # User decided not to overwrite - echo "Using existing ${template_dir}" - fi - fi -else - # Template directory does not exist, download it - echo "Downloading ${template_url}" - download_template -fi - -echo "Applying ${template} template to this project"} -./.gitea/templates/${template}/apply.sh -a "${repo_owner}" -n "${repo_name}" -u "${repo_urlname}" -d "Awesome ${repo_name} created by ${repo_owner}" - -# echo "Removing temporary template files" -# rm -rf .gitea/templates/${template} - -echo "Done! review, commit and push the changes" diff --git a/gitea/release_message.sh b/gitea/release_message.sh deleted file mode 100755 index f5a9062..0000000 --- a/gitea/release_message.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -previous_tag=$(git tag --sort=-creatordate | sed -n 2p) -git shortlog "${previous_tag}.." | sed 's/^./ &/' diff --git a/gitea/rename_project.sh b/gitea/rename_project.sh deleted file mode 100755 index b5ede16..0000000 --- a/gitea/rename_project.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -while getopts a:n:u:d: flag -do - case "${flag}" in - a) author=${OPTARG};; - n) name=${OPTARG};; - u) urlname=${OPTARG};; - d) description=${OPTARG};; - esac -done - -echo "Author: $author"; -echo "Project Name: $name"; -echo "Project URL name: $urlname"; -echo "Description: $description"; - -echo "Renaming project..." - -original_author="author_name" -original_name="project_name" -original_urlname="project_urlname" -original_description="project_description" -# for filename in $(find . -name "*.*") -for filename in $(git ls-files) -do - sed -i "s/$original_author/$author/g" $filename - sed -i "s/$original_name/$name/g" $filename - sed -i "s/$original_urlname/$urlname/g" $filename - sed -i "s/$original_description/$description/g" $filename - echo "Renamed $filename" -done - -mv project_name $name - -# This command runs only once on GHA! -rm -rf .gitea/template.yml diff --git a/gitea/template.yml b/gitea/template.yml deleted file mode 100644 index 3386bee..0000000 --- a/gitea/template.yml +++ /dev/null @@ -1 +0,0 @@ -author: rochacbruno diff --git a/gitea/workflows/release.yml b/gitea/workflows/release.yml deleted file mode 100644 index 99bbf3d..0000000 --- a/gitea/workflows/release.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Upload Python Package -permissions: - contents: write - -on: - push: - # Sequence of patterns matched against refs/tags - tags: - - '*' # Push events to matching v*, i.e. v1.0, v20.15.10 - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - release: - name: Create Release - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit - fetch-depth: 0 - - name: Generate Changelog - run: .gitea/release_message.sh > release_message.md - - name: Release - uses: softprops/action-gh-release@v1 - with: - body_path: release_message.md - - deploy: - needs: release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* diff --git a/gitea/workflows/rename_project.yml b/gitea/workflows/rename_project.yml deleted file mode 100644 index 6e4148f..0000000 --- a/gitea/workflows/rename_project.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Rename the project from template - -on: [push] - -permissions: write-all - -jobs: - rename-project: - if: ${{ !contains (github.repository, '/python-project-template') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit - fetch-depth: 0 - ref: ${{ github.head_ref }} - - - run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - shell: bash - - - run: echo "REPOSITORY_URLNAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV - shell: bash - - - run: echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV - shell: bash - - - name: Is this still a template - id: is_template - run: echo "::set-output name=is_template::$(ls .gitea/template.yml &> /dev/null && echo true || echo false)" - - - name: Rename the project - if: steps.is_template.outputs.is_template == 'true' - run: | - echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}" - .gitea/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "Awesome ${{ env.REPOSITORY_NAME }} created by ${{ env.REPOSITORY_OWNER }}" - - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "✅ Ready to clone and code." - # commit_options: '--amend --no-edit' - push_options: --force