diff --git a/.changeset/config.json b/.changeset/config.json index 7247412a..bc7b425c 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,7 +4,7 @@ "commit": false, "fixed": [["@treasure-dev/tdk-core", "@treasure-dev/tdk-react"]], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml index 7a956d10..6e87832d 100644 --- a/.github/workflows/deploy-api.yml +++ b/.github/workflows/deploy-api.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest environment: ${{ inputs.environment }} steps: - - name: Checkout repo + - name: Check out repo uses: actions/checkout@v4 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/deploy-login.yml b/.github/workflows/deploy-login.yml index 7ef75aa9..8d11fe71 100644 --- a/.github/workflows/deploy-login.yml +++ b/.github/workflows/deploy-login.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest environment: ${{ inputs.environment }} steps: - - name: Checkout repo + - name: Check out repo uses: actions/checkout@v4 - - name: Setup flyctl + - name: Set up flyctl uses: superfly/flyctl-actions/setup-flyctl@master - name: Deploy run: flyctl deploy --config ./apps/login/fly.toml --app ${{ vars.LOGIN_APP_NAME }} --remote-only --build-secret dotenv="${{ secrets.LOGIN_ENV }}" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..843c97d0 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,24 @@ +name: PR Checks +on: pull_request +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies + run: npm ci + - name: Generate code + run: npm run generate + - name: Build packages + run: npm run build:react + - name: Check types + run: npm run typecheck + - name: Run linter + run: npm run lint + - name: Run tests + run: npm test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2e9b87f9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release TDK Packages +on: + push: + branches: + - main +concurrency: ${{ github.workflow }}-${{ github.ref }} +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies + run: npm ci + - name: Create release PR or publish to npm + uses: changesets/action@v1 + with: + version: npm run package:version + publish: npm run package:release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 0e5f9fbb..79afbef6 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,11 @@ "build": "npm run build --workspaces --if-present", "build:core": "npm run build --prefix ./packages/core", "build:api": "npm run build:core && npm run build --prefix ./apps/api", - "build:react": "npm run build:api && npm run build --prefix ./packages/react", + "build:react": "npm run build:core && npm run build --prefix ./packages/react", "build:login": "npm run build:react && npm run build --prefix ./apps/login", "build:examples:harvester": "npm run build:react && npm run build --prefix ./examples/harvester", "build:examples:payments": "npm run build:react && npm run build --prefix ./examples/payments", + "generate": "npm run generate --workspaces --if-present", "dev": "concurrently \"npm run dev:core\" \"npm run dev:api\" \"npm run dev:react\"", "dev:core": "npm run dev --prefix ./packages/core", "dev:api": "npm run dev --prefix ./apps/api", @@ -21,9 +22,10 @@ "typecheck": "tsc --noEmit", "format": "eslint --fix . && prettier --write --ignore-unknown .", "lint": "eslint .", - "test": "vitest", + "test": "vitest run", "package:changeset": "changeset", "package:version": "changeset version", + "package:publish": "changeset publish", "prepare": "husky" }, "devDependencies": {