After making a new compiler release, do the following to redeploy Try PureScript using the new compiler.
- Submit a PR with the following changes:
- In
stack.yaml
,- update the
resolver
to match the same one used in the PureScript repo - update
purescript
to use its new version.
- update the
- Update the package set (see next section's instructions).
- Update the shared config by running
cd client && npm run updateConfigVersions
. - Update the changelog to include the next release's date.
- In
- Once the PR is merged, create a new GitHub tagged release using
vYYYY-MM-DD.X
(whereX
is usually1
or the release attempt) as the version schema. The release will trigger a GitHub Actions build. - Wait for the GitHub Actions build to finish (it builds the assets)
- Run
./deploy/run.sh vX-X-X.1
, replacingvX-X-X.1
with the version you created.- Note: if you're updating the compiler, be sure to push the corresponding tag to
purescript-metadata
. Otherwise,spago install
will fail on the server and prevent the server from starting.
- Note: if you're updating the compiler, be sure to push the corresponding tag to
The try.purescript.org server only has a limited amount of memory. If the package set we use in deployment is too large, the server will run out of memory.
Before deploying an updated package set, someone (your reviewer) should check that the memory required to hold the package set's externs files does not exceed that of the try.purescript.org server.
Update the package set by doing the following. Each step is explained below:
pushd staging
spago upgrade-set
cat > spago.dhall << EOF
{ name = "try-purescript-server"
, dependencies = [] : List Text
, packages = ./packages.dhall
, sources = [ "src/**/*.purs" ]
}
EOF
spago ls packages | cut -f 1 -d ' ' | xargs spago install
popd
pushd client
npm run updateConfigVersions
popd
# add any new shims
# update ES Module Shims (if needed)
-
Update the
upstream
package set instaging/packages.dhall
:``` $ pushd staging && spago upgrade-set && popd ```
-
Set the
dependencies
key in thespago.dhall
file to be an empty list. This will require a type annotation ofList Text
:```dhall { name = "try-purescript-server" , dependencies = [] : List Text , packages = ./packages.dhall , sources = [ "src/**/*.purs" ] } ```
-
For
staging/spago.dhall
, install all packages in the package set by running this command:``` $ spago ls packages | cut -f 1 -d ' ' | xargs spago install ```
-
Update the
client/src/Try/SharedConfig.purs
file by running this command inclient
:```console $ npm run updateConfigVersions ```
-
If any packages need NPM dependencies, you can try adding their shims to the import map in
client/public/frame.html
- Open up the
generator.jspm.io
URL in the comment - Use the 'Add Dependency' search bar to find the NPM dependency
- If it exists but doesn't exist in that CDN, you can try another one or open an issue on
jspm/project
- If it exists but doesn't exist in that CDN, you can try another one or open an issue on
- Update the version to the one you need once added
- If needed, include other files from that dependency
- Copy and paste the content into the
client/public/frame.html
file - Ensure
es-module-shims
has version1.5.9
or greater.
- Open up the
-
If
es-module-shims
releases a new version, you can calculate its SHA-384 via```console $ ESM_VERSION=1.5.5 $ curl -L -o es-module-shims.js "https://ga.jspm.io/npm:es-module-shims@$ESM_VERSION/dist/es-module-shims.js" $ echo "sha384-$(openssl dgst -sha384 -binary es-module-shims.js | openssl base64 -A)" $ rm es-module-shims.js ```