Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": ["@0xsequence/wallet-primitives-cli", "docs", "web"]
"ignore": []
}
20 changes: 11 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v5
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 0 additions & 4 deletions .github/workflows/on_pr_pnpm-format-label.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: pnpm-format-label

permissions:
contents: read
issues: write

on:
pull_request:
types: [labeled]
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/publish-dists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish Dists for Packages

permissions:
contents: write

on:
workflow_dispatch:
push:
branches:
- master

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/install-dependencies

- name: Build package
run: pnpm run build

- name: Prepare dist branch
run: |
PACKAGES=("services/guard" "services/identity-instrument" "services/relayer" "wallet/core" "wallet/primitives" "wallet/wdk" "wallet/dapp-client")

for PACKAGE in "${PACKAGES[@]}"; do
BRANCH="dists/$PACKAGE"
PKG_DIR="packages/$PACKAGE"

echo "📦 Publishing $PACKAGE to $BRANCH"

mkdir -p /tmp/$PACKAGE
shopt -s dotglob
cp -r $PKG_DIR/* /tmp/$PACKAGE || true

cd /tmp/$PACKAGE
git init
git checkout -b $BRANCH

git config user.name "github-actions"
git config user.email "actions@github.com"

echo "🔧 Rewriting workspace: deps in package.json..."
node -e '
const fs = require("fs");
const path = require("path");
const pkgPath = path.resolve("package.json");
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
const repo = "github:0xsequence/sequence.js";

const versions = {
"@0xsequence/guard": `${repo}#dists/services/guard`,
"@0xsequence/identity-instrument": `${repo}#dists/services/identity-instrument`,
"@0xsequence/relayer": `${repo}#dists/services/relayer`,
"@0xsequence/wallet-core": `${repo}#dists/wallet/core`,
"@0xsequence/wallet-primitives": `${repo}#dists/wallet/primitives`,
"@0xsequence/wallet-wdk": `${repo}#dists/wallet/wdk`,
};

const rewrite = (deps = {}) => {
for (const k in deps) {
if (deps[k].startsWith("workspace:")) {
const version = versions[k];

if (!version) {
console.warn(`No version found for ${k}, skipping...`);
continue;
}

deps[k] = version;
console.log(`→ ${k} → ${deps[k]}`);
}
}
};

rewrite(pkg.dependencies);
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
'

git add .
git commit -m "Build: publish $PACKAGE dist"

git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push -f origin HEAD:$BRANCH

cd -
done
Loading
Loading