Skip to content

Commit

Permalink
add pr checks and release ci workflows (#25)
Browse files Browse the repository at this point in the history
* add changelog and versioning scripts

* add changeset ci workflow

* add pr checks workflow

* add build steps to pr job
  • Loading branch information
alecananian authored May 5, 2024
1 parent 7c6cbb8 commit bd1cf07
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-login.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down

0 comments on commit bd1cf07

Please sign in to comment.