Skip to content

Commit

Permalink
Merge branch 'master' into KIT-2722-throw-invalid-directory-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart authored Nov 5, 2023
2 parents 9f161a4 + 9095775 commit 34d3968
Show file tree
Hide file tree
Showing 53 changed files with 1,721 additions and 316 deletions.
2 changes: 1 addition & 1 deletion .github/actions/e2e-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ runs:
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
if: cancelled() || failure() || success()
with:
name: ${{inputs.os}}-${{inputs.spec}}-test-artifacts
name: ${{inputs.os}}-${{inputs.node}}-${{inputs.spec}}-test-artifacts
path: ./packages/cli-e2e/artifacts
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-20.04', 'windows-latest']
node: ['18', '20']
spec:
[
'angular.specs.ts',
Expand All @@ -151,7 +152,7 @@ jobs:
spec: auth.specs.ci.ts
env:
# ID of the test run to identify resources to teardown.
TEST_RUN_ID: 'id${{ matrix.os }}-${{ github.sha }}-${{ github.run_attempt }}g'
TEST_RUN_ID: 'id${{ matrix.os }}-${{ matrix.node }}-${{ github.sha }}-${{ github.run_attempt }}g'
COVEO_DISABLE_AUTOUPDATE: true
CLI_CONFIG_JSON: ${{needs.e2e-setup-login.outputs.cliConfigJson}}
steps:
Expand Down
111 changes: 86 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ on:
type: boolean
default: false
required: false
env:
E2E_USE_NPM_REGISTRY: true
# Platform environment to log into for the e2e tests.
PLATFORM_ENV: 'stg'
# Username used to log into the organization whose ID is stored in the ORG_ID variable
PLATFORM_USER_NAME: ${{ secrets.PLATFORM_USER_NAME }}
# Password used to log into the organization whose ID is stored in the ORG_ID variable
PLATFORM_USER_PASSWORD: ${{ secrets.PLATFORM_USER_PASSWORD }}
# API key to delete all the API keys created by the e2e tests
PLATFORM_API_KEY: ${{ secrets.PLATFORM_API_KEY }}
# ID of the organization to log into for the e2e tests
ORG_ID: ${{ secrets.ORG_ID }}
# Passphrase use to encode/decode cliConfig
E2E_TOKEN_PASSPHRASE: ${{ secrets.E2E_TOKEN_PASSPHRASE }}

jobs:
e2e-setup-login:
Expand Down Expand Up @@ -61,6 +75,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
VERSION: ${{ inputs.version }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEBUG: ${{ inputs.debug && '*' || '' }}
- name: Prepare artifacts
run: |
Expand Down Expand Up @@ -113,7 +128,7 @@ jobs:
cache: 'npm'
node-version-file: '.nvmrc'
- name: Download artifacts
uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: npm-release
- name: Apply & delete the patch
Expand All @@ -134,15 +149,17 @@ jobs:
- name: Find modified Snapshots
id: snapshots-path
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "snapshotsPath<<$EOF" >> "$GITHUB_ENV"
git diff --name-only *.yml >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
{
echo 'snapshotsPath<<EOF'
git diff --name-only **/*.snap
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Upload Jest Snapshots
if: ${{ steps.snapshots-path.outputs.snapshotsPath != ''}}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
with:
name: release-e2e-snaps
path: ${{ env.snapshotsPath }}
path: ${{ steps.snapshots-path.outputs.snapshotsPath }}
e2e-teardown:
name: End-to-end teardown
if: ${{ always() }}
Expand All @@ -164,8 +181,49 @@ jobs:
- uses: ./.github/actions/e2e-clean
with:
cliConfigJson: ${{ env.CLI_CONFIG_JSON }}
release-git:
unit-tests:
name: Unit Tests
runs-on: 'ubuntu-20.04'
needs: [release-npm]
steps:
- name: Setup runner
# Ensure we can use as many file watcher as we want. see https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/troubleshooting.md#npm-start-fail-due-to-watch-error
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
cache: 'npm'
node-version-file: '.nvmrc'
- name: Download artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: npm-release
- name: Apply & delete the patch
run: |
git apply release.patch
rm release.patch
- name: Setup repo
run: npm ci
- name: Build
run: npm run build
- name: Tests
run: npm run test:ci:snap
- name: Find modified Snapshots
id: snapshots-path
run: |
{
echo 'snapshotsPath<<EOF'
git diff --name-only **/*.snap
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Upload Jest Snapshots
if: ${{ steps.snapshots-path.outputs.snapshotsPath != ''}}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
with:
name: release-e2e-snaps
path: ${{ steps.snapshots-path.outputs.snapshotsPath }}
release-git:
needs: [e2e, release-npm, unit-tests]
environment: 'Release'
runs-on: ubuntu-20.04
env:
Expand All @@ -181,15 +239,15 @@ jobs:
cache: 'npm'
node-version-file: '.nvmrc'
- name: Download NPM artifacts
uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: npm-release
- name: Apply & delete the patch
run: |
git apply release.patch
rm release.patch
- name: Download E2E artifacts
uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: release-e2e-snaps
- name: Install dependencies
Expand Down Expand Up @@ -250,7 +308,7 @@ jobs:
cache: 'npm'
node-version-file: '.nvmrc'
- name: Download artifacts
uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: npm-release
- name: Apply & delete the patch
Expand All @@ -261,8 +319,10 @@ jobs:
run: npm ci
- name: Get CLI version
run: |
echo "cliVersion=" >> "$GITHUB_ENV"
cat packages/cli/core/package.json | jq '.version' >> "$GITHUB_ENV"
{
printf "CLI_VERSION="
cat packages/cli/core/package.json | jq -r '.version'
} >> "$GITHUB_ENV"
- name: Build
run: npm run build
- name: Setup Temporary Keychain
Expand Down Expand Up @@ -298,19 +358,19 @@ jobs:
New-Item -Force -ItemType directory -Path tmp
echo "${{ secrets.COVEO_PFX }}" > ./tmp/cert.txt
certutil -decode ./tmp/cert.txt ./tmp/cert.pfx
Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.exe" -PassThru | Wait-Process
Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-${{env.cliversion}}-${{env.commitSHA1}}-x86.exe" -PassThru | Wait-Process
Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.exe" -PassThru | Wait-Process
Start-Process -FilePath "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" -ArgumentList "sign /f ./tmp/cert.pfx /p ${{ secrets.COVEO_PFX_PWD }} /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 ./dist/win32/coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x86.exe" -PassThru | Wait-Process
- name: Sign Executable (macOS)
working-directory: ./packages/cli/core/dist/macos
if: ${{matrix.os == 'macos-latest'}}
run: |
echo "Signing for ARM64 architecture"
security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg --keychain build.keychain
productsign --sign $MACOS_WWDR_TEAM_ID coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64.pkg coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg --keychain build.keychain
echo "Signing for X64 architecture"
security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
productsign --sign $MACOS_WWDR_TEAM_ID coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg --keychain build.keychain
productsign --sign $MACOS_WWDR_TEAM_ID coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.pkg coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg --keychain build.keychain
- name: Notarize Executable (macOS)
working-directory: ./packages/cli/core/dist/macos
if: ${{matrix.os == 'macos-latest'}}
Expand All @@ -322,20 +382,20 @@ jobs:
xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.MACOS_APP_USERNAME }}" --team-id "${{ secrets.MACOS_WWDR_TEAM_ID }}" --password "${{ secrets.MACOS_APP_SPECIFIC_PWD }}"
echo "Creating temp notarization archive"
ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "notarization-arm64.zip"
ditto -c -k --keepParent "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "notarization-x64.zip"
ditto -c -k --keepParent "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg" "notarization-arm64.zip"
ditto -c -k --keepParent "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg" "notarization-x64.zip"
echo "Notarizing app"
xcrun notarytool submit "notarization-arm64.zip" --keychain-profile "notarytool-profile" --wait
xcrun notarytool submit "notarization-x64.zip" --keychain-profile "notarytool-profile" --wait
echo "Attaching staple"
xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg"
xcrun stapler staple "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg"
xcrun stapler staple "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg"
xcrun stapler staple "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg"
echo "Deleting unsigned packages"
mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-x64.pkg"
mv "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64-signed.pkg" "coveo-${{env.cliversion}}-${{env.commitSHA1}}-arm64.pkg"
mv "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg" "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.pkg"
mv "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg" "coveo-v${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64.pkg"
rm notarization-arm64.zip notarization-x64.zip
- name: Upload binaries
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
Expand All @@ -360,13 +420,14 @@ jobs:
cache: 'npm'
node-version-file: '.nvmrc'
- name: Download NPM artifacts
uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: npm-release
- name: Download binaries artifacts
uses: actions/download-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: release-binaries
path: release-binaries
- name: Apply & delete the patch
run: |
git apply release.patch
Expand All @@ -388,6 +449,6 @@ jobs:
uses: svenstaro/upload-release-action@7319e4733ec7a184d739a6f412c40ffc339b69c7 # 2.5.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./packages/cli/core/dist/**/*
file: ./release-binaries/**/*
file_glob: true
tag: ${{ env.tag }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20.9.0
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# release-19 (2023-10-27)

### Bug Fixes

- only diff json files ([#1323](https://github.com/coveo/cli/issues/1323)) ([ae1361a](https://github.com/coveo/cli/commits/ae1361a4ca0f553103349ca436a309c61aa56732))

### Features

- add organization to event props ([#1325](https://github.com/coveo/cli/issues/1325)) ([3afcd0f](https://github.com/coveo/cli/commits/3afcd0f78112de9eae8f91218be3df01757f8d3e))
- **cli:** change node support to 18.18.1 ([#1332](https://github.com/coveo/cli/issues/1332)) ([54c6937](https://github.com/coveo/cli/commits/54c6937829685e1af20949f082b2de484fa1f6c6))
- **cli:** change node support to only 18-20 ([#1335](https://github.com/coveo/cli/issues/1335)) ([3e65207](https://github.com/coveo/cli/commits/3e6520737650901d2b176fadc8e2e56441a8d4da))
- **cli:** deprecate config:set region and environment ([#1331](https://github.com/coveo/cli/issues/1331)) ([341d5a7](https://github.com/coveo/cli/commits/341d5a70ab92c492ff653242dabf50f154192710))
- **cli:** node 20.9.0 lts ([#1337](https://github.com/coveo/cli/issues/1337)) ([af1c3ac](https://github.com/coveo/cli/commits/af1c3ac1796bdfd534b5d037f3a42e23aa3ab225))
- **cli:** use hidden prompt or stdin for auth:token command ([#1334](https://github.com/coveo/cli/issues/1334)) ([012b6a4](https://github.com/coveo/cli/commits/012b6a45adc474f1d10a8adf5a881eb9faf5e6e8))
- support imports from `/headless` ([#1326](https://github.com/coveo/cli/issues/1326)) ([d24bec4](https://github.com/coveo/cli/commits/d24bec48e5050ffdbba406fe130a7f7a83ca9b95))

### BREAKING CHANGES

- **cli:** those flags are no longer supported by the cli and the
alternative is to re-execute a login flow with auth:login

This change is part of the effort for the next major release of the CLI
(v3)

# release-18 (2023-08-24)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $ npm install -g @coveo/cli
$ coveo COMMAND
running command...
$ coveo (--version)
@coveo/cli/2.2.0 linux-x64 node-v18.12.1
@coveo/cli/3.0.15 linux-x64 node-v20.9.0
$ coveo --help [COMMAND]
USAGE
$ coveo COMMAND
Expand Down
Loading

0 comments on commit 34d3968

Please sign in to comment.