|
| 1 | +name: Provenance |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + - master |
| 9 | + paths: |
| 10 | + - ".github/workflows/provenance.yml" |
| 11 | + - ".github/workflows/ci.yml" |
| 12 | + - "README.md" |
| 13 | + - "SETUP.md" |
| 14 | + - "mkdocs.yml" |
| 15 | + - "docs/**" |
| 16 | + - "api-server/**" |
| 17 | + - "chrome-bridge/**" |
| 18 | + - "chrome-demo/**" |
| 19 | + - "python-mediapipe/**" |
| 20 | + pull_request: |
| 21 | + paths: |
| 22 | + - ".github/workflows/provenance.yml" |
| 23 | + - ".github/workflows/ci.yml" |
| 24 | + - "README.md" |
| 25 | + - "SETUP.md" |
| 26 | + - "mkdocs.yml" |
| 27 | + - "docs/**" |
| 28 | + - "api-server/**" |
| 29 | + - "chrome-bridge/**" |
| 30 | + - "chrome-demo/**" |
| 31 | + - "python-mediapipe/**" |
| 32 | + |
| 33 | +permissions: |
| 34 | + contents: read |
| 35 | + attestations: write |
| 36 | + id-token: write |
| 37 | + artifact-metadata: write |
| 38 | + |
| 39 | +jobs: |
| 40 | + attest-demo-bundle: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + timeout-minutes: 20 |
| 43 | + permissions: |
| 44 | + contents: read |
| 45 | + attestations: write |
| 46 | + id-token: write |
| 47 | + artifact-metadata: write |
| 48 | + env: |
| 49 | + GH_TOKEN: ${{ github.token }} |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 |
| 52 | + |
| 53 | + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| 54 | + with: |
| 55 | + python-version: "3.12" |
| 56 | + cache: pip |
| 57 | + cache-dependency-path: api-server/requirements.txt |
| 58 | + |
| 59 | + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
| 60 | + with: |
| 61 | + node-version: "22" |
| 62 | + cache: npm |
| 63 | + cache-dependency-path: chrome-bridge/package-lock.json |
| 64 | + |
| 65 | + - name: Validate api-server |
| 66 | + working-directory: api-server |
| 67 | + env: |
| 68 | + SKIP_INTEGRATION: "1" |
| 69 | + run: | |
| 70 | + pip install -r requirements.txt |
| 71 | + pip install pytest ruff |
| 72 | + ruff check . |
| 73 | + python -m pytest test_server.py -q |
| 74 | +
|
| 75 | + - name: Validate chrome-bridge |
| 76 | + working-directory: chrome-bridge |
| 77 | + run: | |
| 78 | + npm ci --ignore-scripts |
| 79 | + npm test |
| 80 | +
|
| 81 | + - name: Build docs site |
| 82 | + run: | |
| 83 | + pip install mkdocs-material |
| 84 | + mkdocs build --strict |
| 85 | +
|
| 86 | + - name: Create Gemini Nano demo bundle |
| 87 | + run: | |
| 88 | + tar -czf "gemini-nano-demo-bundle-${GITHUB_SHA}.tar.gz" \ |
| 89 | + README.md \ |
| 90 | + SETUP.md \ |
| 91 | + mkdocs.yml \ |
| 92 | + docs \ |
| 93 | + site \ |
| 94 | + api-server/server.py \ |
| 95 | + api-server/requirements.txt \ |
| 96 | + api-server/start.ps1 \ |
| 97 | + chrome-bridge/server.js \ |
| 98 | + chrome-bridge/package.json \ |
| 99 | + chrome-bridge/package-lock.json \ |
| 100 | + chrome-bridge/start.ps1 \ |
| 101 | + chrome-demo/index.html \ |
| 102 | + python-mediapipe/requirements.txt \ |
| 103 | + python-mediapipe/run_nano.py |
| 104 | + sha256sum "gemini-nano-demo-bundle-${GITHUB_SHA}.tar.gz" | tee "gemini-nano-demo-bundle-${GITHUB_SHA}.sha256" |
| 105 | +
|
| 106 | + - name: Attest Gemini Nano demo bundle |
| 107 | + id: attest |
| 108 | + uses: actions/attest@f6bf1532d7d6793fce74eac584813a8eee607999 # v4 |
| 109 | + with: |
| 110 | + subject-path: "gemini-nano-demo-bundle-${{ github.sha }}.tar.gz" |
| 111 | + |
| 112 | + - name: Verify current run attestation |
| 113 | + run: | |
| 114 | + gh attestation verify "gemini-nano-demo-bundle-${GITHUB_SHA}.tar.gz" \ |
| 115 | + --repo Coding-Autopilot-System/gemini-nano \ |
| 116 | + --signer-workflow Coding-Autopilot-System/gemini-nano/.github/workflows/provenance.yml \ |
| 117 | + --source-ref "${GITHUB_REF}" |
| 118 | +
|
| 119 | + - name: Publish Gemini Nano demo bundle |
| 120 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
| 121 | + with: |
| 122 | + name: gemini-nano-demo-bundle |
| 123 | + path: | |
| 124 | + gemini-nano-demo-bundle-${{ github.sha }}.tar.gz |
| 125 | + gemini-nano-demo-bundle-${{ github.sha }}.sha256 |
| 126 | +
|
| 127 | + - name: Publish Gemini Nano attestation bundle |
| 128 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
| 129 | + with: |
| 130 | + name: gemini-nano-attestation-bundle |
| 131 | + path: ${{ steps.attest.outputs.bundle-path }} |
| 132 | + |
| 133 | + - name: Write provenance summary |
| 134 | + run: | |
| 135 | + { |
| 136 | + echo "## Gemini Nano Provenance" |
| 137 | + echo |
| 138 | + echo "- Artifact: \`gemini-nano-demo-bundle-${GITHUB_SHA}.tar.gz\`" |
| 139 | + echo "- Attestation: ${{ steps.attest.outputs.attestation-url }}" |
| 140 | + echo "- Bundle artifact: \`gemini-nano-attestation-bundle\`" |
| 141 | + } >> "$GITHUB_STEP_SUMMARY" |
0 commit comments