-
Notifications
You must be signed in to change notification settings - Fork 3
/
Earthfile
50 lines (41 loc) · 1.17 KB
/
Earthfile
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
VERSION 0.8
FROM node:22.12.0
WORKDIR /build
build:
COPY package.json package-lock.json .
CACHE /root/.npm
RUN npm ci
COPY --dir src tsconfig*.json .
RUN npm run build
SAVE ARTIFACT dist/ dist
integrate-test:
FROM +build
COPY --dir integrate_tests tests .
RUN rm -rf dist
COPY +build/dist dist
RUN npm run integrate_test
# Test publishing from local purpose
prepublish:
BUILD +integrate-test
LOCALLY
RUN rm -rf dist
COPY +build/dist dist
# Bump package.json and jsr.json then commit the changes that mimic `npm version`
RUN npm version prerelease --no-git-tag-version && \
npm run jsr:version && \
git add jsr.json package*.json && \
jq -r '.version' package.json | xargs -I {} git commit -m "{}"
RUN npm publish --provenance --tag=beta
RUN npm install && npx -y jsr publish
publish:
BUILD +integrate-test
LOCALLY
ARG --required VERSION
RUN rm -rf dist
COPY +build/dist dist
RUN npm version $VERSION && \
npm run jsr:version && \
git add jsr.json package*.json && \
jq -r '.version' package.json | xargs -I {} git commit -m "{}"
RUN npm publish --provenance
RUN npm install && npx -y jsr publish