Skip to content

Commit

Permalink
Move last updated file generation to be above attestations step
Browse files Browse the repository at this point in the history
  • Loading branch information
mimi-imtbl committed Dec 17, 2024
1 parent 13de51f commit 04796e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,18 @@ jobs:
tag: ${{ contains(env.RELEASE_TYPE, 'alpha') && 'alpha' }}
dry-run: ${{ env.DRY_RUN }}

- name: Generate last_updated.json
if: (env.DRY_RUN) == 'false'
run: |
echo "{\"timestamp\": \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\"}" > ./sdk/last_updated.json
cp ./sdk/last_updated.json ./sdk/dist/
# ! Do NOT remove - this will cause a Sev 0 incident !
- name: Generate SDK attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: './sdk'

- name: Generate last_updated.json
if: (env.DRY_RUN) == 'false'
run: |
echo "{\"last_updated\": \"$(date -u +"%Y-%m-%dT%H:%M:%SZ")\"}" > ./sdk/last_updated.json
cp ./sdk/last_updated.json ./sdk/dist/
- name: Authenticate NPM
if: contains(env.RELEASE_TYPE, 'release')
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.TS_IMMUTABLE_SDK_NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion packages/checkout/sdk/src/widgets/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function latestCompatibleVersion(
* @returns {Promise<boolean>} A promise resolving to `true` if last_updated.json exists and is older than 15 minutes, `false` otherwise.
*/
async function checkLastUpdatedTimestamp(version: string): Promise<boolean> {
const WAIT_TIME_IN_MINUTES = 20;
const WAIT_TIME_IN_MINUTES = 45;

const lastUpdatedJsonUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${version}/dist/last_updated.json`;

Expand Down

0 comments on commit 04796e0

Please sign in to comment.