-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 2.12 KB
/
Copy pathrelease.yml
File metadata and controls
69 lines (57 loc) · 2.12 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
name: Release
on:
push:
tags: ["v*"]
# The package records the commit it was built from, and the host checks that
# against the commit the release tag resolves to. Building from anything other
# than the tagged commit produces a package that warns on every install.
permissions:
contents: write
jobs:
release:
name: Build and publish the package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# No `version:` here on purpose — `packageManager` in package.json is the
# single source of truth, and specifying both is an error.
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- uses: oven-sh/setup-bun@v2
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck && pnpm test && pnpm build
- name: Check out OpenWork for the app tools
uses: actions/checkout@v4
with:
repository: different-ai/openwork
ref: dev
path: .openwork
sparse-checkout: |
packages/app-contract
packages/app-tools
- name: Refuse a tag that disagrees with the manifest version
run: |
MANIFEST_VERSION=$(node -p "require('./openwork.app.json').version")
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "$MANIFEST_VERSION" != "$TAG_VERSION" ]; then
echo "Tag $GITHUB_REF_NAME does not match manifest version $MANIFEST_VERSION" >&2
exit 1
fi
- name: Build and verify the package
run: |
cd .openwork
pnpm install --filter @openwork/app-contract --filter @openwork/app-tools
pnpm --filter @openwork/app-contract build
pnpm --filter @openwork/app-tools build
cd ..
node scripts/package.mjs \
--tools .openwork/packages/app-tools/bin/openwork-app.mjs \
--tag "$GITHUB_REF_NAME" \
--commit "$GITHUB_SHA"
- name: Attach the package to the release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "$GITHUB_REF_NAME" release/* --clobber