Skip to content

Commit b11f217

Browse files
committed
ci: add changeset and better ci workflows
1 parent 6f2c0d9 commit b11f217

File tree

16 files changed

+369
-115
lines changed

16 files changed

+369
-115
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "js2me/mobx-view-model" }
6+
],
7+
"commit": false,
8+
"fixed": [],
9+
"linked": [],
10+
"access": "restricted",
11+
"baseBranch": "master",
12+
"updateInternalDependencies": "patch",
13+
"ignore": []
14+
}

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: js2me

.github/workflows/build.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy docs to Pages
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Version or Publish"]
6+
types: [completed]
7+
8+
permissions: read-all
9+
10+
concurrency:
11+
group: pages
12+
cancel-in-progress: true
13+
14+
jobs:
15+
deploy:
16+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
17+
environment:
18+
name: github-pages
19+
url: ${{ steps.deployment.outputs.page_url }}
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout tree
27+
uses: actions/checkout@v4
28+
29+
- name: Set-up Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
check-latest: true
33+
node-version-file: .nvmrc
34+
35+
- run: corepack enable
36+
37+
- run: pnpm docs:install
38+
39+
- run: pnpm docs:build
40+
41+
- name: Set-up Pages
42+
uses: actions/configure-pages@v5
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: docs/.vitepress/dist
48+
49+
- name: Deploy odoc to GitHub Pages
50+
uses: actions/deploy-pages@v4
51+
id: deployment

.github/workflows/github-pages.yaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Builds, tests & co
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
permissions: read-all
8+
9+
jobs:
10+
build-and-test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
node-version: [24]
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout tree
18+
uses: actions/checkout@v4
19+
20+
- name: Set-up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
check-latest: true
24+
node-version: ${{ matrix.node-version }}
25+
26+
- run: corepack enable
27+
28+
- run: pnpm i
29+
30+
- run: pnpm docs:install
31+
32+
- run: pnpm check
33+
34+
- run: pnpm build
35+
36+
- run: pnpm docs:build
37+
38+
- run: pnpm test:coverage

.github/workflows/test.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Version or Publish
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Builds, tests & co"]
6+
types: [completed]
7+
8+
concurrency: ${{ github.workflow }}
9+
10+
permissions: read-all
11+
12+
jobs:
13+
release:
14+
if: ${{ github.repository_owner == 'js2me' && github.event.workflow_run.conclusion == 'success' }}
15+
permissions:
16+
contents: write # to create release
17+
id-token: write # to generate provenance
18+
issues: write # to post issue comments
19+
pull-requests: write # to create pull request
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout tree
23+
uses: actions/checkout@v4
24+
25+
- name: Set-up Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
check-latest: true
29+
node-version-file: .nvmrc
30+
31+
- run: corepack enable
32+
- run: pnpm i
33+
34+
- name: Create Release Pull Request
35+
uses: changesets/action@v1
36+
continue-on-error: false
37+
id: pub-or-release-pr
38+
with:
39+
version: pnpm changeset version
40+
publish: pnpm pub-ci
41+
env:
42+
GITHUB_TOKEN: ${{ github.token }}
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

0 commit comments

Comments
 (0)