diff --git a/.github/CodeEditSourceEditor-Icon-128@2x.png b/.github/CodeEditSourceEditor-Icon-128@2x.png new file mode 100644 index 00000000..6bb503b9 Binary files /dev/null and b/.github/CodeEditSourceEditor-Icon-128@2x.png differ diff --git a/.github/CodeEditTextView-Icon-128@2x.png b/.github/CodeEditTextView-Icon-128@2x.png new file mode 100644 index 00000000..7e8a479a Binary files /dev/null and b/.github/CodeEditTextView-Icon-128@2x.png differ diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..d4a0b1e1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,56 @@ +name: 🐞 Bug report +description: Something is not working as expected. +title: 🐞 +labels: bug + +body: + - type: textarea + attributes: + label: Description + placeholder: >- + A clear and concise description of what the bug is... + validations: + required: true + + - type: textarea + attributes: + label: To Reproduce + description: >- + Steps to reliably reproduce the behavior. + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + + - type: textarea + attributes: + label: Expected Behavior + placeholder: >- + A clear and concise description of what you expected to happen... + validations: + required: true + + - type: textarea + attributes: + label: Version Information + description: >- + click on the version number on the welcome screen + value: | + CodeEditTextView: [e.g. 0.x.y] + macOS: [e.g. 13.2.1] + Xcode: [e.g. 14.2] + + - type: textarea + attributes: + label: Additional Context + placeholder: >- + Any other context or considerations about the bug... + + - type: textarea + attributes: + label: Screenshots + placeholder: >- + If applicable, please provide relevant screenshots or screen recordings... diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..476a7721 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,31 @@ +name: ✨ Feature request +description: Suggest an idea for this project +title: ✨ +labels: enhancement + +body: + - type: textarea + attributes: + label: Description + placeholder: >- + A clear and concise description of what you would like to happen... + validations: + required: true + + - type: textarea + attributes: + label: Alternatives Considered + placeholder: >- + Any alternative solutions or features you've considered... + + - type: textarea + attributes: + label: Additional Context + placeholder: >- + Any other context or considerations about the feature request... + + - type: textarea + attributes: + label: Screenshots + placeholder: >- + If applicable, please provide relevant screenshots or screen recordings... diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..d976c3fa --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,30 @@ + + +### Description + + + +### Related Issues + + + + + +* #ISSUE_NUMBER + +### Checklist + + + +- [ ] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md) +- [ ] The issues this PR addresses are related to each other +- [ ] My changes generate no new warnings +- [ ] My code builds and runs on my machine +- [ ] My changes are all related to the related issue above +- [ ] I documented my code + +### Screenshots + + + + diff --git a/.github/scripts/build-docc.sh b/.github/scripts/build-docc.sh new file mode 100755 index 00000000..b50abd17 --- /dev/null +++ b/.github/scripts/build-docc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +export LC_CTYPE=en_US.UTF-8 + +set -o pipefail && xcodebuild clean docbuild -scheme CodeEditTextView \ + -destination generic/platform=macos \ + -skipPackagePluginValidation \ + OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path CodeEditTextView --output-path ./docs" | xcpretty diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh new file mode 100755 index 00000000..c90874f4 --- /dev/null +++ b/.github/scripts/tests.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +ARCH="" + +if [ $1 = "arm" ] +then + ARCH="arm64" +else + ARCH="x86_64" +fi + +echo "Building with arch: ${ARCH}" + +export LC_CTYPE=en_US.UTF-8 + +set -o pipefail && arch -"${ARCH}" xcodebuild \ + -scheme CodeEditTextView \ + -derivedDataPath ".build" \ + -destination "platform=macos,arch=${ARCH}" \ + -skipPackagePluginValidation \ + clean test | xcpretty diff --git a/.github/workflows/CI-pull-request.yml b/.github/workflows/CI-pull-request.yml new file mode 100644 index 00000000..384d52a7 --- /dev/null +++ b/.github/workflows/CI-pull-request.yml @@ -0,0 +1,16 @@ +name: CI - Pull Request +on: + pull_request: + branches: + - 'main' + workflow_dispatch: +jobs: + swiftlint: + name: SwiftLint + uses: ./.github/workflows/swiftlint.yml + secrets: inherit + test: + name: Testing CodeEditTextView + needs: swiftlint + uses: ./.github/workflows/tests.yml + secrets: inherit diff --git a/.github/workflows/CI-push.yml b/.github/workflows/CI-push.yml new file mode 100644 index 00000000..bcff6c07 --- /dev/null +++ b/.github/workflows/CI-push.yml @@ -0,0 +1,21 @@ +name: CI - Push to main +on: + push: + branches: + - 'main' + workflow_dispatch: +jobs: + swiftlint: + name: SwiftLint + uses: ./.github/workflows/swiftlint.yml + secrets: inherit + test: + name: Testing CodeEditTextView + needs: swiftlint + uses: ./.github/workflows/tests.yml + secrets: inherit + build_documentation: + name: Build Documentation + needs: [swiftlint, test] + uses: ./.github/workflows/build-documentation.yml + secrets: inherit diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml new file mode 100644 index 00000000..ca822b51 --- /dev/null +++ b/.github/workflows/add-to-project.yml @@ -0,0 +1,20 @@ +name: Add new issues to project + +on: + issues: + types: + - opened + +jobs: + add-to-project: + name: Add new issues labeled with enhancement or bug to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.4.0 + with: + # You can target a repository in a different organization + # to the issue + project-url: https://github.com/orgs/CodeEditApp/projects/3 + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} + labeled: enhancement, bug + label-operator: OR diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml new file mode 100644 index 00000000..3b73dfdd --- /dev/null +++ b/.github/workflows/build-documentation.yml @@ -0,0 +1,54 @@ +name: build-documentation +on: + workflow_dispatch: + workflow_call: +jobs: + build-docc: + runs-on: [self-hosted, macOS] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Build Documentation + run: exec ./.github/scripts/build-docc.sh + - name: Init new repo in dist folder and commit generated files + run: | + cd docs + git init + git add -A + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m 'deploy' + + - name: Force push to destination branch + uses: ad-m/github-push-action@v0.6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: docs + force: true + directory: ./docs + + ############################ + ##### IMPORTANT NOTICE ##### + ############################ + # This was used to build the documentation catalog until + # it didn't produce the 'documentation' directory anymore. + # + # - uses: fwcd/swift-docc-action@v1.0.2 + # with: + # target: CodeEditTextView + # output: ./docs + # hosting-base-path: CodeEditTextView + # disable-indexing: 'true' + # transform-for-static-hosting: 'true' + # + # The command that this plugin uses is: + # + # swift package --allow-writing-to-directory ./docs generate-documentation \ + # --target CodeEditTextView + # --output-path ./docs + # --hosting-base-path CodeEditTextView + # --disable-indexing + # --transform-for-static-hosting + # + # We now use xcodebuild to build the documentation catalog instead. + # diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 00000000..a802661d --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,11 @@ +name: SwiftLint +on: + workflow_dispatch: + workflow_call: +jobs: + SwiftLint: + runs-on: [self-hosted, macOS] + steps: + - uses: actions/checkout@v3 + - name: GitHub Action for SwiftLint with --strict + run: swiftlint --strict diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..a7bef822 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,13 @@ +name: tests +on: + workflow_dispatch: + workflow_call: +jobs: + code-edit-text-view-tests: + name: Testing CodeEditTextView + runs-on: [self-hosted, macOS] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Testing Package + run: exec ./.github/scripts/tests.sh arm