-
Notifications
You must be signed in to change notification settings - Fork 18
72 lines (58 loc) · 2.29 KB
/
Copy pathrelease-commit.yml
File metadata and controls
72 lines (58 loc) · 2.29 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
name: Publish commit preview
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: zcode-cli-preview-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
preview:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version: 24
package-manager-cache: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.4.1
- name: Install extraction tools
run: sudo apt-get update && sudo apt-get install -y p7zip-full
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build and test the locked runtime
run: bun run release:build
- name: Pack and install-test
id: pack
run: bun run release:pack
- name: Verify release metadata is unchanged
run: git diff --exit-code -- package.json zcode-runtime.lock.json
- name: Upload tested package
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: commit-preview-${{ github.event.pull_request.head.sha || github.sha }}
path: |
.release/*.tgz
.release/release.json
include-hidden-files: true
if-no-files-found: error
retention-days: 14
# Install https://github.com/apps/pkg-pr-new on this repository first.
# Upload the exact tarball that passed the install smoke test, without repacking it.
- name: Publish commit package
env:
PREVIEW_TARBALL: ${{ steps.pack.outputs.tarball }}
run: bun run pkg-pr-new publish "$PREVIEW_TARBALL" --bin --comment=update --commentWithSha --no-template --json .release/preview.json
- name: Show preview command
run: |
jq -r '.packages[] | "Preview package: \(.url)\n\n```sh\nnpx --yes \(.url) --resume <session-id>\n```"' .release/preview.json >> "$GITHUB_STEP_SUMMARY"