Skip to content

Commit

Permalink
chore: configure CI
Browse files Browse the repository at this point in the history
  • Loading branch information
macjuul committed Aug 27, 2024
1 parent e9b3292 commit 4514d13
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 34 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install pnpm
run: npm install -g pnpm

- name: Build packages
run: pnpm install --no-frozen-lockfile && pnpm build
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9

- name: Build packages
run: pnpm install --frozen-lockfile && pnpm build

- name: Run tests
run: pnpm test
- name: Run tests
run: pnpm test
62 changes: 42 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,45 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install pnpm
run: npm install -g pnpm

- name: Build packages
run: pnpm install --no-frozen-lockfile && pnpm build

- name: Run tests
run: pnpm test

- name: Publish
run: pnpm publish -r
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9

- name: Extract versions
run: |
echo "GIT_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "CM_VERSION=$(node -p "require('./packages/codemirror-surrealql/package.json').version")" >> $GITHUB_ENV
echo "LZ_VERSION=$(node -p "require('./packages/lezer-surrealql/package.json').version")" >> $GITHUB_ENV
- name: Assert package versions
run: |
echo "CM_VERSION=$CM_VERSION"
echo "LZ_VERSION=$LZ_VERSION"
echo "GIT_TAG=$GIT_TAG"
if [ "$CM_VERSION" != "$GIT_TAG" ] && [ "$LZ_VERSION" != "$GIT_TAG"]; then
echo "Version mismatch! Please correct package versions"
exit 1
else
echo "Version check complete"
fi
- name: Build packages
run: pnpm install --frozen-lockfile && pnpm build

- name: Run tests
run: pnpm test

- name: Publish
run: pnpm publish -r --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion packages/codemirror-surrealql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@surrealdb/codemirror",
"private": true,
"version": "1.0.0-beta.1",
"author": "SurrealDB",
"description": "SurrealQL language support for CodeMirror",
Expand Down
1 change: 0 additions & 1 deletion packages/lezer-surrealql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@surrealdb/lezer",
"private": true,
"version": "1.0.0-beta.1",
"author": "SurrealDB",
"description": "SurrealQL grammar for Lezer",
Expand Down
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4514d13

Please sign in to comment.