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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 80 additions & 42 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,89 @@
name: Upload
name: Check and upload

on:
push:
branches:
- master
- main
branches: [main, master]
pull_request: {}

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.7.3/cr'
name: 'cr'
version: '0.7.3'

- uses: supplypike/setup-bin@v3
with:
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.7.3/caps'
name: 'caps'
version: '0.7.3'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 24
package-manager-cache: false
- uses: calcit-lang/setup-calcit@ca701be5a471759e442aa053cd100720bbe1f09f # v1.5.0
with:
tools: calcit,caps
caps-version: "0.1.1"
deps-file: deps.cirru
- name: Install dependencies
run: |
corepack enable
corepack prepare yarn@4.18.0 --activate
caps --strict --ci
yarn install --immutable
caps verify --toolchain
- name: Check and test Calcit
run: |
set -euo pipefail
calcit edit format
git diff --exit-code -- calcit.cirru
calcit --check-only --all-defs --format json
calcit --check-only --ns app.config --ns app.main --ns app.schema --ns app.updater --ns app.util --ns app.comp.container --ns app.comp.showcase --summary-only --format json
calcit analyze weak-types --ns-prefix app --only deprecated-call --summary-only --format json | jq -e '.data.summary.calls == 0'
calcit analyze weak-types --only dynamic-method --summary-only --format json | jq -e '.data.summary.findings == 0'
calcit test --require-match --summary-only --format json
- name: Build frontend
run: |
calcit js
yarn vite build --base="https://cos-sh.tiye.me/${GITHUB_REPOSITORY}/"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: client-dist
path: dist/
if-no-files-found: error
retention-days: 7

- name: "compiles to js"
run: >
caps --ci && cr --emit-js --once
&& yarn && yarn vite build --base=./
- name: Deploy to server
id: deploy
uses: Pendect/action-rsyncer@v2.0.0
env:
DEPLOY_KEY: ${{secrets.rsync_private_key}}
with:
flags: '-avzr --progress'
options: ''
ssh_options: ''
src: 'dist/*'
dest: 'rsync-user@tiye.me:/web-assets/repo/${{ github.repository }}'

- name: Display status from deploy
run: echo "${{ steps.deploy.outputs.status }}"
upload:
needs: test
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
runs-on: ubuntu-24.04
timeout-minutes: 15
concurrency:
group: cos-${{ github.repository }}
cancel-in-progress: false
queue: max
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: client-dist
path: dist/
- name: Upload and verify frontend resources
uses: worktools/cos-upload-action@v1.2.0
with:
source-dir: dist
bucket: ${{ secrets.COS_BUCKET }}
region: ap-shanghai
prefix: ${{ github.repository }}/
public-base-url: https://cos-sh.tiye.me/${{ github.repository }}/
secret-id: ${{ secrets.COS_SECRET_ID }}
secret-key: ${{ secrets.COS_SECRET_KEY }}
- name: Deploy to original server path
uses: Pendect/action-rsyncer@8e05ffa5c93e5d9c9b167796b26044d2c616b2b9 # v2.0.0
env:
DEPLOY_KEY: ${{ secrets.rsync_private_key }}
with:
flags: '-avzr --progress'
options: ''
ssh_options: ''
src: 'dist/*'
dest: 'rsync-user@tiye.me:/web-assets/repo/${{ github.repository }}'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

.compact-inc.cirru
.calcit-error.cirru
.calcit/
.DS_Store

js-out/
node_modules/
dist/
.yarn/install-state.gz
8 changes: 8 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvedGitRepositories:
- "**"

enableScripts: true

nodeLinker: node-modules

npmMinimalAgeGate: 0
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,40 @@ ClojureScript, beginners' home page
### Workflow

Workflow https://github.com/mvc-works/calcit-workflow
The application uses Calcit 0.29.0 and matching `@calcit/procs`, with stable
module releases pinned in `deps.cirru`. Node.js 24 and Yarn 4.18.0 are used for
the frontend build. `content/*.cljs` are displayed ClojureScript examples, not
Calcit application source.

```sh
caps --strict --ci
yarn install --immutable
caps verify --toolchain
yarn check
calcit test --require-match
yarn build
```

For development, run `yarn watch` and `yarn serve` in separate terminals. Open
the Vite URL with `?mode=dev` to enable the existing Reel tools.

The application Store, actions, showcases and tool cards have explicit nominal
types. The legacy Respo component-state payload and incoming dispatcher remain
open boundaries, so this is not a claim of zero Dynamic type debt.
Stored data retains the original Map field format and is decoded into Store
when restored. Startup still chooses a random showcase, as before.

CI checks all admitted definitions and all application public definitions,
runs the two attached updater/hydration tests, and builds the frontend.
Local acceptance also includes real browser rendering, code highlighting,
showcase clicks, and refresh/hydration without runtime errors.

Main/master deployment uploads frontend resources through
`worktools/cos-upload-action` with built-in public checksum verification. The
original server destination is unchanged. Repository deployment requires
`COS_BUCKET`, `COS_SECRET_ID`, `COS_SECRET_KEY`, and `rsync_private_key`;
no deployment secrets were listed during this migration. PR checks build
without deployment credentials. Generated `js-out/` and `dist/` stay untracked.

### License

Expand Down
Loading
Loading