Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: uniform cliversion/cliVersion-> CLI_VERSION+ run on ut #1371

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 55 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ jobs:
id: snapshots-path
run: |
{
echo "snapshotsPath<<EOF"
echo 'snapshotsPath<<EOF'
git diff --name-only **/*.snap
echo EOF
} >> "$GITHUB_ENV"
} >> "$GITHUB_OUTPUT"
- name: Upload Jest Snapshots
if: ${{ env.snapshotsPath != ''}}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
Expand Down Expand Up @@ -181,8 +181,49 @@ jobs:
- uses: ./.github/actions/e2e-clean
with:
cliConfigJson: ${{ env.CLI_CONFIG_JSON }}
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
- 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: ${{ env.snapshotsPath != ''}}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
with:
name: release-e2e-snaps
path: ${{ env.snapshotsPath }}
release-git:
needs: [e2e, release-npm]
needs: [e2e, release-npm, unit-tests]
environment: 'Release'
runs-on: ubuntu-20.04
env:
Expand Down Expand Up @@ -279,7 +320,7 @@ jobs:
- name: Get CLI version
run: |
{
printf "cliVersion="
printf "CLI_VERSION="
cat packages/cli/core/package.json | jq -r '.version'
} >> "$GITHUB_ENV"
- name: Build
Expand Down Expand Up @@ -317,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-${{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-${{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-${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64.pkg coveo-${{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-${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.pkg coveo-${{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 @@ -341,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-${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg" "notarization-arm64.zip"
ditto -c -k --keepParent "coveo-${{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-${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg"
xcrun stapler staple "coveo-${{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-${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64-signed.pkg" "coveo-${{env.CLI_VERSION}}-${{env.commitSHA1}}-x64.pkg"
mv "coveo-${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64-signed.pkg" "coveo-${{env.CLI_VERSION}}-${{env.commitSHA1}}-arm64.pkg"
rm notarization-arm64.zip notarization-x64.zip
- name: Upload binaries
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
Expand Down
Loading