Skip to content

Commit

Permalink
feat: supporting Sign/Verify with multiple images (#62)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Jul 2, 2024
1 parent 917aaf6 commit 78caa37
Show file tree
Hide file tree
Showing 348 changed files with 42,999 additions and 46,481 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: npm
- name: Install TypeScript
run: npm install -g typescript
- name: Show versions
run: |
echo node js version: $(node -v)
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/e2e-test-sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Build and push to local registry
id: prepare
id: image1
uses: docker/build-push-action@v4
with:
context: ./tests/e2e
push: true
tags: localhost:5000/e2e:latest
tags: localhost:5000/image1:latest
- name: Build and push to local registry
id: image2
uses: docker/build-push-action@v4
with:
context: ./tests/e2e
push: true
tags: localhost:5000/image2:latest
- name: Retrieve digest
run: |
echo "target_artifact_reference=localhost:5000/e2e@${{ steps.prepare.outputs.digest }}" >> "$GITHUB_ENV"
echo "target_artifact_reference=localhost:5000/image1@${{ steps.image1.outputs.digest }}" >> "$GITHUB_ENV"
echo "target_artifact_reference2=localhost:5000/image2@${{ steps.image2.outputs.digest }}" >> "$GITHUB_ENV"
# Setting up Notation CLI on the runner
- name: Setup Notation
Expand All @@ -64,6 +72,20 @@ jobs:
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
- name: Sign multiple artifacts using notation plugin
uses: ./sign
with:
plugin_name: e2e-test-plugin
plugin_url: https://github.com/notaryproject/notation-action/raw/e2e-test-plugin/tests/plugin_binaries/notation-e2e-test-plugin_0.1.0_linux_amd64.tar.gz
plugin_checksum: be8d035024d3a96afb4118af32f2e201f126c7254b02f7bcffb3e3149d744fd2
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: |-
${{ env.target_artifact_reference }}
${{ env.target_artifact_reference2 }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
- name: Sign artifact with multiple plugin_config
uses: ./sign
Expand Down
29 changes: 24 additions & 5 deletions .github/workflows/e2e-test-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Build and push to local registry
id: prepare
id: image1
uses: docker/build-push-action@v4
with:
context: ./tests/e2e
push: true
tags: localhost:5000/e2e:latest
tags: localhost:5000/image1:latest
- name: Build and push to local registry
id: image2
uses: docker/build-push-action@v4
with:
context: ./tests/e2e
push: true
tags: localhost:5000/image2:latest
- name: Retrieve digest
run: |
echo "target_artifact_reference=localhost:5000/e2e@${{ steps.prepare.outputs.digest }}" >> "$GITHUB_ENV"
echo "target_artifact_reference=localhost:5000/image1@${{ steps.image1.outputs.digest }}" >> "$GITHUB_ENV"
echo "target_artifact_reference2=localhost:5000/image2@${{ steps.image2.outputs.digest }}" >> "$GITHUB_ENV"
# Setting up Notation CLI on the runner
- name: Setup Notation
Expand All @@ -56,14 +64,16 @@ jobs:
cp ${{ env.E2E_CERT }} ${GITHUB_WORKSPACE}/tests/e2e/truststore/x509/ca/e2e-test/e2e-test.crt
# Sign artifact
- name: Sign artifact using notation plugin
- name: Sign multiple artifacts using notation plugin
uses: ./sign
with:
plugin_name: e2e-test-plugin
plugin_url: https://github.com/notaryproject/notation-action/raw/e2e-test-plugin/tests/plugin_binaries/notation-e2e-test-plugin_0.1.0_linux_amd64.tar.gz
plugin_checksum: be8d035024d3a96afb4118af32f2e201f126c7254b02f7bcffb3e3149d744fd2
key_id: ${{ env.E2E_CERT }}
target_artifact_reference: ${{ env.target_artifact_reference }}
target_artifact_reference: |-
${{ env.target_artifact_reference }}
${{ env.target_artifact_reference2 }}
signature_format: cose
plugin_config: |-
keyFile=${{ env.E2E_KEY }}
Expand All @@ -83,6 +93,15 @@ jobs:
trust_policy: ./tests/e2e/trustpolicy/trustpolicy.json
trust_store: ./tests/e2e/truststore

- name: Verify multiple released artifacts
uses: ./verify
with:
target_artifact_reference: |-
${{ env.target_artifact_reference }}
${{ env.target_artifact_reference2 }}
trust_policy: ./tests/e2e/trustpolicy/trustpolicy.json
trust_store: ./tests/e2e/truststore

- name: Verify released artifact missing target artifact reference
continue-on-error: true
id: missing-artifact-reference
Expand Down
5 changes: 2 additions & 3 deletions dist/lib/checksum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lib/checksum.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions dist/lib/install.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lib/install.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions dist/sign.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 78caa37

Please sign in to comment.