mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 14:19:58 +00:00
fix: script to parse binary digests (#7493)
This commit is contained in:
parent
79cc2ef3ef
commit
f2712204ed
37
.github/scripts/generate-binary-digest.sh
vendored
Executable file
37
.github/scripts/generate-binary-digest.sh
vendored
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# To test locally, set ARTIFACT_PATH="packages" CLI_ARTIFACT_SHAFILE=cli.sha256 ELECTRON_ARTIFACT_SHAFILE=electron.sha256 ./.github/scripts/generate-binary-digest.sh
|
||||
set -euo pipefail
|
||||
echo "CLI FILES FOUND"
|
||||
cli_files=$(find "${ARTIFACT_PATH}" -type f \( -name "inso-*.zip" -o -name "inso-*.pkg" -o -name "inso-*.tar.xz" \) -exec sha256sum {} \;)
|
||||
echo "${cli_files}"
|
||||
echo "CLI FILES WITH PATH STRIPPED"
|
||||
echo "${cli_files}" | sed "s/\(.* \)\(.*\(inso\)\)/\1\\3/" | sort > "${CLI_ARTIFACT_SHAFILE}"
|
||||
cat "${CLI_ARTIFACT_SHAFILE}"
|
||||
cli_digest=$(base64 -w0 "${CLI_ARTIFACT_SHAFILE}")
|
||||
echo "ELECTRON APP FILES FOUND"
|
||||
app_files=$(find "${ARTIFACT_PATH}" -type f \( -name "Insomnia.Core-*" \) -exec sha256sum {} \;)
|
||||
echo "${app_files}"
|
||||
echo "ELECTRON APP FILES WITH PATH STRIPPED"
|
||||
echo "${app_files}" | sed "s/\(.* \)\(.*\(Insomnia.Core\)\)/\1\\3/" | sort > "${ELECTRON_ARTIFACT_SHAFILE}"
|
||||
cat "${ELECTRON_ARTIFACT_SHAFILE}"
|
||||
app_digest=$(base64 -w0 "${ELECTRON_ARTIFACT_SHAFILE}")
|
||||
|
||||
if [[ -z "$(cat ${CLI_ARTIFACT_SHAFILE})" ]]; then
|
||||
echo "CLI Artifacts SHA256 Digest file generation failed"
|
||||
exit 1
|
||||
else
|
||||
echo "CLI FILE DIGEST"
|
||||
echo "${cli_digest}"
|
||||
fi
|
||||
|
||||
if [[ -z "$(cat ${ELECTRON_ARTIFACT_SHAFILE})" ]]; then
|
||||
echo "ELECTRON Artifacts SHA256 Digest file generation failed"
|
||||
exit 1
|
||||
else
|
||||
echo "ELECTRON APP FILE DIGEST"
|
||||
echo "${app_digest}"
|
||||
fi
|
||||
|
||||
echo "inso_binary_artifact_digest_base64=${cli_digest}" >> "$GITHUB_OUTPUT"
|
||||
echo "electron_binary_artifact_digest_base64=${app_digest}" >> "$GITHUB_OUTPUT"
|
30
.github/workflows/release-publish.yml
vendored
30
.github/workflows/release-publish.yml
vendored
@ -64,31 +64,11 @@ jobs:
|
||||
run: |
|
||||
INSO_VERSION=$(jq .version packages/insomnia-inso/package.json -rj)
|
||||
echo "INSO_VERSION=${INSO_VERSION}" >> $GITHUB_ENV
|
||||
|
||||
ARTIFACT_PATH="${{ env.ARTIFACTS_DOWNLOAD_PATH }}"
|
||||
|
||||
# To test set ARTIFACT_PATH to a local path, containing an inso-1.zip and Insomnia.Core-1.zip and paste the next 18 lines in a terminal
|
||||
echo "CLI FILES FOUND"
|
||||
cli_files=$(find "${ARTIFACT_PATH}" -type f \( -name "inso-*.zip" -o -name "inso-*.pkg" -o -name "inso-*.tar.xz" \) -exec sha256sum {} \;)
|
||||
echo "${cli_files}"
|
||||
echo "CLI FILES WITH PATH STRIPPED"
|
||||
cli_replaced_files=$(echo "${cli_files}" | sed "s/\(.* \)\(.*\(inso\)\)/\1\\3/" | sort)
|
||||
echo "${cli_replaced_files}"
|
||||
echo "CLI FILE DIGEST"
|
||||
cli_digest=$(echo "${cli_replaced_files}" | base64 -w0)
|
||||
echo "${cli_digest}"
|
||||
echo "APP FILES FOUND"
|
||||
app_files=$(find "${ARTIFACT_PATH}" -type f \( -name "Insomnia.Core-*" \) -exec sha256sum {} \;)
|
||||
echo "${app_files}"
|
||||
echo "APP FILES WITH PATH STRIPPED"
|
||||
app_replaced_files=$(echo "${app_files}" | sed "s/\(.* \)\(.*\(Insomnia.Core\)\)/\1\\3/" | sort)
|
||||
echo "${app_replaced_files}"
|
||||
echo "APP FILE DIGEST"
|
||||
app_digest=$(echo "${app_replaced_files}" | base64 -w0)
|
||||
echo "${app_digest}"
|
||||
|
||||
echo "inso_binary_artifact_digest_base64=${cli_digest}" >> $GITHUB_OUTPUT
|
||||
echo "electron_binary_artifact_digest_base64=${app_digest}" >> $GITHUB_OUTPUT
|
||||
./.github/scripts/generate-binary-digest.sh
|
||||
env:
|
||||
ARTIFACT_PATH: "${{ env.ARTIFACTS_DOWNLOAD_PATH }}"
|
||||
CLI_ARTIFACT_SHAFILE: ${{runner.temp}}/cli.sha256
|
||||
ELECTRON_ARTIFACT_SHAFILE: ${{runner.temp}}/electron.sha256
|
||||
|
||||
- name: Temporarily move artifacts
|
||||
shell: bash
|
||||
|
11
.github/workflows/release-recurring.yml
vendored
11
.github/workflows/release-recurring.yml
vendored
@ -53,6 +53,17 @@ jobs:
|
||||
- name: Package
|
||||
shell: bash
|
||||
run: NODE_OPTIONS='--max_old_space_size=6144' BUILD_TARGETS='${{ matrix.build-targets }}' npm run app-package
|
||||
|
||||
# - name: Set publish metadata # Checksum for provenance must be calculated before moving artifacts temporarily
|
||||
# id: metadata
|
||||
# run: |
|
||||
# INSO_VERSION=$(jq .version packages/insomnia-inso/package.json -rj)
|
||||
# echo "INSO_VERSION=${INSO_VERSION}" >> $GITHUB_ENV
|
||||
# ./.github/scripts/generate-binary-digest.sh
|
||||
# env:
|
||||
# ARTIFACT_PATH: "packages"
|
||||
# CLI_ARTIFACT_SHAFILE: ${{runner.temp}}/cli.sha256
|
||||
# ELECTRON_ARTIFACT_SHAFILE: ${{runner.temp}}/electron.sha256
|
||||
|
||||
- name: Test critical path on packaged electron app
|
||||
run: npm run test:package -w packages/insomnia-smoke-test -- --project=Critical
|
||||
|
Loading…
Reference in New Issue
Block a user