Repository navigation
117 lines (101 loc) · 3.84 KB
/
Copy pathchangeset-version.yml
File metadata and controls
117 lines (101 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Create Pull Request or Release
on:
push:
branches:
- main
permissions:
contents: write
id-token: write
pull-requests: write
# Publishing the cloud image to GHCR.
packages: write
jobs:
publish-openscad-cdn:
uses: ./.github/workflows/publish-openscad-cdn.yml
secrets: inherit
release:
needs: publish-openscad-cdn
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: Build packages
run: |
pnpm build
- name: Build vscode package
run: |
pnpm --filter "hyperbook-studio" vscode:package
- name: Verify default CDN runtimes before publishing
# CDN previews must work before any consumer package can be published.
# Validate all files against the locally built runtime bundles.
run: node scripts/verify-default-cdns.mjs
- name: Publish CLI asset bundles before npm
run: node packages/hyperbook/publish-assets.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v2
with:
publish-script: pnpm release
version-script: pnpm version-packages
github-token: ${{ secrets.GITHUB_TOKEN }}
# The release commit and tags go over the git CLI, as before.
push-with-git-cli: true
- name: Publish VS Code extension
if: steps.changesets.outputs.published == 'true'
run: |
pnpm --filter "hyperbook-studio" vscode:publish
pnpm --filter "hyperbook-studio" ovsx:publish
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
OVSX_PAT: ${{ secrets.OVSX_TOKEN }}
# The cloud platform is private to npm but is published as a container
# image, so self-hosters have something versioned to pull instead of
# tracking main. Runs on the same gate as the other publish steps, after
# changesets has bumped the version in package.json.
- name: Read cloud version
if: steps.changesets.outputs.published == 'true'
id: cloud
run: echo "version=$(node -p "require('./platforms/cloud/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
if: steps.changesets.outputs.published == 'true'
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
if: steps.changesets.outputs.published == 'true'
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: steps.changesets.outputs.published == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish cloud image
if: steps.changesets.outputs.published == 'true'
uses: docker/build-push-action@v6
with:
context: .
file: platforms/cloud/Dockerfile
# arm64 covers the small boxes schools tend to self-host on.
# better-sqlite3 ships prebuilt binaries for both, so neither is
# compiled under emulation.
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/openpatch/hyperbook-cloud:${{ steps.cloud.outputs.version }}
ghcr.io/openpatch/hyperbook-cloud:latest
cache-from: type=gha
cache-to: type=gha,mode=max