diff --git a/.github/workflows/Quality.yaml b/.github/workflows/Quality.yaml new file mode 100644 index 0000000..7ef4279 --- /dev/null +++ b/.github/workflows/Quality.yaml @@ -0,0 +1,19 @@ +name: Quality + +on: + workflow_dispatch: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: "20 14 * * 1" + +jobs: + Quality: + uses: gesslar/Maint/.github/workflows/Quality.yaml@main + secrets: inherit + with: + package_manager: "auto" + perform_linting: "${{ vars.PERFORM_LINTING }}" + perform_testing: "${{ vars.PERFORM_TESTING }}" diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml new file mode 100644 index 0000000..bf16258 --- /dev/null +++ b/.github/workflows/Release.yaml @@ -0,0 +1,17 @@ +name: Release + +on: + pull_request: + types: [closed] + branches: [main] + +jobs: + Release: + if: github.event.pull_request.merged == true + uses: gesslar/Maint/.github/workflows/Release.yaml@main + secrets: inherit + with: + package_manager: "auto" + quality_check: "Quality" + permissions: + contents: write diff --git a/.github/workflows/autopr-dev.yml b/.github/workflows/autopr-dev.yml deleted file mode 100644 index 6730aa3..0000000 --- a/.github/workflows/autopr-dev.yml +++ /dev/null @@ -1,58 +0,0 @@ -# Workflow name - shows up in GitHub Actions UI -name: Auto PR and Merge - dev 🤗 - -# Defines when this workflow will run -on: - # push: - # merge_group: - # branches: - # - dev # Only triggers when pushing to the 'dev' branch - workflow_dispatch: - -# Add this permissions block at the workflow level -permissions: - contents: write # Needed for checking out code and pushing changes - pull-requests: write # Needed for creating and merging PRs - -jobs: - create-and-merge-pr: # Job identifier - runs-on: ubuntu-latest # Specifies the runner environment - steps: - # Step 1: Check out repository - - uses: actions/checkout@v4 # Official GitHub checkout action - with: - ref: main # Checks out the main branch as we'll be creating a PR into it - - # Step 2: Reset the main branch to match dev branch - - name: Reset branch - run: | - git fetch origin dev:dev # Fetches the dev branch - git reset --hard dev # Resets main to match dev branch content - - - name: Create Pull Request - id: cpr # Gives this step an ID so we can reference its outputs later - uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # Uses peter-evans PR creation action - with: - branch: dev-to-main # Name of the temporary branch for the PR - token: ${{ secrets.GITHUB_TOKEN }} # Uses default GitHub token for authentication - assignees: gesslar # Adds @gesslar as an assignee - reviewers: gesslar # Adds @gesslar as a reviewer - - # Step 4: Output PR details for logging/debugging - - name: Check outputs - if: ${{ steps.cpr.outputs.pull-request-number }} # Only runs if a PR was created - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" - - # Step 5: Automatically merge the Pull Request - - name: Merge Pull Request - if: ${{ steps.cpr.outputs.pull-request-number }} # Only runs if a PR was created - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Token for authentication - PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} # PR number from create step - run: | - # Merges PR, using --merge for standard merge commit - # --auto enables auto-merge if checks are required - # --delete-branch removes the temporary branch after merging - gh pr merge $PR_NUMBER --merge --auto --delete-branch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 18a40f7..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,99 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL Advanced" - -on: - push: - branches: ["main"] - pull_request: - branches: ["main"] - schedule: - - cron: "20 5 * * 3" - -# Add this concurrency block -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read - - # only required for workflows in private repositories - actions: read - contents: read - - strategy: - fail-fast: false - matrix: - include: - - language: actions - build-mode: none - - language: javascript-typescript - build-mode: none - # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - if: matrix.build-mode == 'manual' - shell: bash - run: | - echo 'If you are using a "manual" build mode for one or more of the' \ - 'languages you are analyzing, replace this with the commands to build' \ - 'your code, for example:' - echo ' make bootstrap' - echo ' make release' - exit 1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/rebase-base-into-pr.yml b/.github/workflows/rebase-base-into-pr.yml deleted file mode 100644 index 3062a55..0000000 --- a/.github/workflows/rebase-base-into-pr.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Auto-Rebase Base Branch into PR - -on: - pull_request_target: - types: [auto_merge_enabled] # Runs when PR is set to automerge - -jobs: - rebase_base_branch: - permissions: - contents: write # Allows pushing changes - pull-requests: write # Allows modifying PRs - runs-on: ubuntu-latest - steps: - - name: Determine base branch - id: base - run: echo "BASE_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV - - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Rebase base branch into PR branch - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - git fetch origin $BASE_BRANCH - git rebase origin/$BASE_BRANCH || (git rebase --abort && echo "Rebase failed, resolve manually.") - - git push --force-with-lease && echo "Rebase successful!" || echo "Push failed, manual fix needed."