Skip to content

Commit e1be2cd

Browse files
authored
Merge pull request #10 from auths-dev/dev-verifyArtifact
build: uncomment ci
2 parents 49c194b + ff38d0c commit e1be2cd

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,3 @@ jobs:
4545
with:
4646
fail-on-unsigned: true
4747

48-
# TODO: Enable after first signed release (just release X.Y.Z runs auths artifact sign dist/index.js)
49-
# verify-artifacts:
50-
# runs-on: ubuntu-latest
51-
# needs: build-and-test
52-
# steps:
53-
# - uses: actions/checkout@v4
54-
# with:
55-
# fetch-depth: 0
56-
#
57-
# - name: Verify dist/index.js attestation
58-
# uses: ./
59-
# with:
60-
# identity-bundle: ... # provide bundle path or inline JSON
61-
# artifact-paths: 'dist/index.js'
62-
# fail-on-unattested: true

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ jobs:
7575
7676
echo "Signed dist/index.js → dist/index.js.auths.json"
7777
78+
# --- Verify the artifact we just signed (dogfood) ---
79+
- name: Verify dist/index.js attestation
80+
if: hashFiles('dist/index.js.auths.json') != ''
81+
uses: ./
82+
with:
83+
identity-bundle-json: ${{ secrets.AUTHS_CI_IDENTITY_BUNDLE_JSON }}
84+
artifact-paths: 'dist/index.js'
85+
fail-on-unattested: true
86+
fail-on-unsigned: false
87+
7888
- name: Generate SHA256 checksums
7989
run: |
8090
cd dist

scripts/ci-setup.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ else
142142
echo -e "${GREEN}${RESET} CI device linked"
143143
fi
144144

145-
# --- Step 8: Package identity repo ---
145+
# --- Step 8: Package identity repo (for release signing) ---
146146
AUTHS_DIR="${HOME}/.auths"
147147
echo -e "${DIM}Packaging identity repo...${RESET}"
148148

@@ -161,6 +161,17 @@ tar -czf "$BUNDLE_PATH" \
161161

162162
IDENTITY_BUNDLE_B64=$(base64 < "$BUNDLE_PATH" | tr -d '\n')
163163

164+
# --- Step 8b: Export identity bundle JSON (for CI artifact verification) ---
165+
echo -e "${DIM}Exporting identity bundle JSON (1-year TTL)...${RESET}"
166+
BUNDLE_JSON_PATH="$TMPDIR_WORK/identity-bundle.json"
167+
auths id export-bundle \
168+
--alias ci-release-device \
169+
--output "$BUNDLE_JSON_PATH" \
170+
--max-age-secs 31536000
171+
172+
IDENTITY_BUNDLE_JSON=$(cat "$BUNDLE_JSON_PATH")
173+
echo -e "${GREEN}${RESET} Identity bundle JSON exported (expires in 1 year)"
174+
164175
# --- Step 9: Set GitHub secrets ---
165176
echo ""
166177
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
@@ -186,10 +197,11 @@ if [ "$GH_OK" -eq 1 ]; then
186197
echo -n "$CI_PASS" | gh secret set AUTHS_CI_PASSPHRASE --repo "$REPO" || GH_OK=0
187198
echo -n "$KEYCHAIN_B64" | gh secret set AUTHS_CI_KEYCHAIN --repo "$REPO" || GH_OK=0
188199
echo -n "$IDENTITY_BUNDLE_B64" | gh secret set AUTHS_CI_IDENTITY_BUNDLE --repo "$REPO" || GH_OK=0
200+
echo -n "$IDENTITY_BUNDLE_JSON" | gh secret set AUTHS_CI_IDENTITY_BUNDLE_JSON --repo "$REPO" || GH_OK=0
189201
fi
190202

191203
if [ "$GH_OK" -eq 1 ]; then
192-
echo -e "${GREEN}${RESET} All 3 secrets set on ${CYAN}${REPO}${RESET}"
204+
echo -e "${GREEN}${RESET} All 4 secrets set on ${CYAN}${REPO}${RESET}"
193205
else
194206
echo -e "${YELLOW}Could not set secrets automatically.${RESET}"
195207
echo -e "${DIM}Try: gh auth login then re-run, or add manually:${RESET}"
@@ -203,6 +215,9 @@ else
203215
echo ""
204216
echo -e "${BOLD}AUTHS_CI_IDENTITY_BUNDLE${RESET}"
205217
echo "$IDENTITY_BUNDLE_B64"
218+
echo ""
219+
echo -e "${BOLD}AUTHS_CI_IDENTITY_BUNDLE_JSON${RESET}"
220+
echo "$IDENTITY_BUNDLE_JSON"
206221
fi
207222

208223
echo ""

0 commit comments

Comments
 (0)