Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": false,
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"privatePackages": {
"version": true,
"tag": true
}
}
5 changes: 5 additions & 0 deletions .changeset/sixty-roses-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shopify-buy": patch
---

Adding changeset and github ci release with provenance
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release new NPM version

on:
pull_request:
types: [closed]
branches:
- main

concurrency:
group: changeset-${{ github.head_ref }}
cancel-in-progress: true

jobs:
npm:
name: Changeset release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build package
run: npm run build

# - name: Publish to NPM
# id: changesets
# uses: changesets/action@v1
# with:
# version: npm run version
# publish: npm run changeset publish
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# NPM_CONFIG_PROVENANCE: true
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI Tests

on:
push:
Expand All @@ -12,12 +12,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node and yarn
- name: Setup node and npm
uses: actions/setup-node@v3
with:
cache: npm
- name: NPM install
run: npm ci
run: npm ci --legacy-peer-deps
shell: bash
- run: npm test

46 changes: 46 additions & 0 deletions .github/workflows/upload-release-cdn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Upload release to CDN (AWS S3)

on:
pull_request:
types: [closed]
branches:
- main

concurrency:
group: changeset-${{ github.head_ref }}
cancel-in-progress: true

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: npm ci --legacy-peer-deps

- name: Build package
run: npm run build

- name: Decrypt secrets
run: |
echo "EJSON decrypt key is: ${{ secrets.EJSON_SECRET }}" # > ejson_secret.txt
npx ejson decrypt -o secrets.json secrets.ejson
env:
EJSON_SECRET: ${{ secrets.EJSON_SECRET }} # Your secret key for decryption

# - name: Upload built assets
# run: node scripts/upload-to-cdn.js
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ optimized-types.js
# Build artifacts
index.*
!docs/index.html
build

# Decrypted secrets
secrets.json
.nvmrc

.DS_Store

# VSCode settings
.vscode
.vscode

Loading