From 525412c96a10c841c5c81d537bec3536b6a7a498 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:01:52 -0400 Subject: [PATCH 1/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 006b2c5f32d..c717b371744 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [GitHub Desktop](https://desktop.github.com/) is an open source [Electron](https://www.electronjs.org/)-based GitHub app. It is written in [TypeScript](https://www.typescriptlang.org) and -uses [React](https://reactjs.org/). +uses [React](https://reactjs.org/). test Date: Tue, 31 Oct 2023 09:07:49 -0400 Subject: [PATCH 2/7] Update ci.yml --- .github/workflows/ci.yml | 93 ++++------------------------------------ 1 file changed, 9 insertions(+), 84 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e113903455..22f24c7d5cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,44 +5,18 @@ on: branches: - development pull_request: - workflow_call: - inputs: - repository: - default: desktop/desktop - required: false - type: string - ref: - required: true - type: string - upload-artifacts: - default: false - required: false - type: boolean - environment: - type: string - required: true - secrets: - DESKTOP_OAUTH_CLIENT_ID: - DESKTOP_OAUTH_CLIENT_SECRET: - APPLE_ID: - APPLE_ID_PASSWORD: - APPLE_TEAM_ID: - APPLE_APPLICATION_CERT: - APPLE_APPLICATION_CERT_PASSWORD: - WINDOWS_CERT_PFX: - WINDOWS_CERT_PASSWORD: jobs: lint: name: Lint runs-on: ubuntu-latest env: - RELEASE_CHANNEL: ${{ inputs.environment }} + RELEASE_CHANNEL: development steps: - uses: actions/checkout@v4 with: - repository: ${{ inputs.repository || github.repository }} - ref: ${{ inputs.ref }} + repository: ${{ github.repository }} + ref: ${{ github.ref }} submodules: recursive - uses: actions/setup-node@v3 with: @@ -63,86 +37,37 @@ jobs: fail-fast: false matrix: node: [18.16.1] - os: [macos-13-xl-arm64, windows-2019] - arch: [x64, arm64] + os: [macos-13-xl-arm64] + arch: [x64] include: - os: macos-13-xl-arm64 friendlyName: macOS - - os: windows-2019 - friendlyName: Windows timeout-minutes: 60 env: - RELEASE_CHANNEL: ${{ inputs.environment }} + RELEASE_CHANNEL: development steps: - uses: actions/checkout@v4 with: - repository: ${{ inputs.repository || github.repository }} - ref: ${{ inputs.ref }} + repository: ${{ github.repository }} + ref: ${{ github.ref }} submodules: recursive - - uses: actions/setup-python@v4 - with: - python-version: '3.11' - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: yarn - - # This step can be removed as soon as official Windows arm64 builds are published: - # https://github.com/nodejs/build/issues/2450#issuecomment-705853342 - - name: Get NodeJS node-gyp lib for Windows arm64 - if: ${{ matrix.os == 'windows-2019' && matrix.arch == 'arm64' }} - run: .\script\download-nodejs-win-arm64.ps1 ${{ matrix.node }} - - name: Install and build dependencies run: yarn env: npm_config_arch: ${{ matrix.arch }} TARGET_ARCH: ${{ matrix.arch }} - name: Build production app - run: yarn build:prod - env: - DESKTOP_OAUTH_CLIENT_ID: ${{ secrets.DESKTOP_OAUTH_CLIENT_ID }} - DESKTOP_OAUTH_CLIENT_SECRET: - ${{ secrets.DESKTOP_OAUTH_CLIENT_SECRET }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - APPLE_APPLICATION_CERT: ${{ secrets.APPLE_APPLICATION_CERT }} - KEY_PASSWORD: ${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }} - npm_config_arch: ${{ matrix.arch }} - TARGET_ARCH: ${{ matrix.arch }} + run: yarn build:dev - name: Prepare testing environment - if: matrix.arch == 'x64' run: yarn test:setup env: npm_config_arch: ${{ matrix.arch }} - name: Run unit tests - if: matrix.arch == 'x64' run: yarn test:unit - name: Run script tests - if: matrix.arch == 'x64' run: yarn test:script - - name: Install Windows code signing certificate - if: ${{ runner.os == 'Windows' }} - shell: bash - env: - CERT_CONTENTS: ${{ secrets.WINDOWS_CERT_PFX }} - run: base64 -d <<<"$CERT_CONTENTS" > ./script/windows-certificate.pfx - - name: Package production app - run: yarn package - env: - npm_config_arch: ${{ matrix.arch }} - WINDOWS_CERT_PASSWORD: ${{ secrets.WINDOWS_CERT_PASSWORD }} - - name: Upload artifacts - uses: actions/upload-artifact@v3 - if: ${{ inputs.upload-artifacts }} - with: - name: ${{matrix.friendlyName}}-${{matrix.arch}} - path: | - dist/GitHub Desktop-${{matrix.arch}}.zip - dist/GitHubDesktop-*.nupkg - dist/GitHubDesktopSetup-${{matrix.arch}}.exe - dist/GitHubDesktopSetup-${{matrix.arch}}.msi - dist/bundle-size.json - if-no-files-found: error From 973b4570e7009c9b5bf9789d861adb760a58ddd9 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:08:52 -0400 Subject: [PATCH 3/7] Slim it down --- .github/workflows/ci.yml | 2 -- .github/workflows/no-response.yml | 32 -------------------- .github/workflows/release-pr.yml | 49 ------------------------------- 3 files changed, 83 deletions(-) delete mode 100644 .github/workflows/no-response.yml delete mode 100644 .github/workflows/release-pr.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22f24c7d5cb..ae87b7237bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 with: - repository: ${{ github.repository }} - ref: ${{ github.ref }} submodules: recursive - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml deleted file mode 100644 index 44d543dc919..00000000000 --- a/.github/workflows/no-response.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: No Response - -# Both `issue_comment` and `scheduled` event types are required for this Action -# to work properly. -on: - issue_comment: - types: [created] - schedule: - # Schedule for five minutes after the hour, every hour - - cron: '5 * * * *' - -permissions: - issues: write - -jobs: - noResponse: - runs-on: ubuntu-latest - steps: - - uses: lee-dohm/no-response@v0.5.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - closeComment: > - Thank you for your issue! - - We haven’t gotten a response to our questions above. With only the - information that is currently in the issue, we don’t have enough - information to take action. We’re going to close this but don’t - hesitate to reach out if you have or find the answers we need. If - you answer our questions above, this issue will automatically - reopen. - daysUntilClose: 7 - responseRequiredLabel: more-info-needed diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml deleted file mode 100644 index 960641b4c47..00000000000 --- a/.github/workflows/release-pr.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: 'Create Release Pull Request' - -on: create - -jobs: - build: - name: Create Release Pull Request - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - uses: actions/checkout@v4 - if: | - startsWith(github.ref, 'refs/heads/releases/') && !contains(github.ref, 'test') - - - name: Create Pull Request content - if: | - startsWith(github.ref, 'refs/heads/releases/') && !contains(github.ref, 'test') - run: | - PR_TITLE=`./script/draft-release/release-pr-content.sh title ${GITHUB_REF#refs/heads/}` - PR_BODY=`./script/draft-release/release-pr-content.sh body ${GITHUB_REF#refs/heads/}` - - echo "PR_BODY<> $GITHUB_ENV - echo "$PR_BODY" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - echo "PR_TITLE<> $GITHUB_ENV - echo "$PR_TITLE" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - - uses: tibdex/github-app-token@v2 - id: generate-token - if: | - startsWith(github.ref, 'refs/heads/releases/') && !contains(github.ref, 'test') - with: - app_id: ${{ secrets.DESKTOP_RELEASES_APP_ID }} - private_key: ${{ secrets.DESKTOP_RELEASES_APP_PRIVATE_KEY }} - - - name: Create Release Pull Request - uses: peter-evans/create-pull-request@v5.0.2 - if: | - startsWith(github.ref, 'refs/heads/releases/') && !contains(github.ref, 'test') - with: - token: ${{ steps.generate-token.outputs.token }} - title: ${{ env.PR_TITLE }} - body: ${{ env.PR_BODY }} - branch: ${{ github.ref }} - base: development - draft: true From d58c8e327dba029deb817c3d02d6ecc05dd51b50 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:13:30 -0400 Subject: [PATCH 4/7] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae87b7237bf..52d5b187340 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,10 @@ jobs: fail-fast: false matrix: node: [18.16.1] - os: [macos-13-xl-arm64] + os: [macos-latest] arch: [x64] include: - - os: macos-13-xl-arm64 + - os: macos-latest friendlyName: macOS timeout-minutes: 60 env: From f325aa77f5db7ef9f5b8eb487db32a346d36ecd1 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:22:17 -0400 Subject: [PATCH 5/7] Fail unit test --- app/test/unit/accounts-store-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/unit/accounts-store-test.ts b/app/test/unit/accounts-store-test.ts index 6c399d3bee1..fbabc091198 100644 --- a/app/test/unit/accounts-store-test.ts +++ b/app/test/unit/accounts-store-test.ts @@ -14,7 +14,7 @@ describe('AccountsStore', () => { describe('adding a new user', () => { it('contains the added user', async () => { - const newAccountLogin = 'joan' + const newAccountLogin = 'joan-WRONG' await accountsStore.addAccount( new Account(newAccountLogin, '', 'deadbeef', [], '', 1, '', 'free') ) From abb5589460163e964042f4a3762adc1c31a6c495 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:25:10 -0400 Subject: [PATCH 6/7] Reduce to just tests --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52d5b187340..666bff4b3e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,13 +59,9 @@ jobs: env: npm_config_arch: ${{ matrix.arch }} TARGET_ARCH: ${{ matrix.arch }} - - name: Build production app - run: yarn build:dev - name: Prepare testing environment run: yarn test:setup env: npm_config_arch: ${{ matrix.arch }} - name: Run unit tests run: yarn test:unit - - name: Run script tests - run: yarn test:script From de3a7e7334509ed451008ced222b7dcad3fdb4be Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:35:54 -0400 Subject: [PATCH 7/7] Actually break the unit tests --- app/test/unit/accounts-store-test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test/unit/accounts-store-test.ts b/app/test/unit/accounts-store-test.ts index fbabc091198..3d48ad5f606 100644 --- a/app/test/unit/accounts-store-test.ts +++ b/app/test/unit/accounts-store-test.ts @@ -14,13 +14,13 @@ describe('AccountsStore', () => { describe('adding a new user', () => { it('contains the added user', async () => { - const newAccountLogin = 'joan-WRONG' + const newAccountLogin = 'joan' await accountsStore.addAccount( new Account(newAccountLogin, '', 'deadbeef', [], '', 1, '', 'free') ) const users = await accountsStore.getAll() - expect(users[0].login).toBe(newAccountLogin) + expect(users[0].login).toBe('joan-WRONG') }) }) })