microsoft/TypeAgent

Public

mirrored from https://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
44a02b6f883d70f4a35ac76069fd6ec79cae9b3f

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/build-package-shell.yml

103lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4# This workflow will build and package the TypeAgent TypeScript code
5
6name: build-package-shell
7
8on:
9 workflow_dispatch:
10 push:
11 branches: ["main"]
12 pull_request:
13 branches: ["main"]
14 merge_group:
15 branches: ["main"]
16
17concurrency:
18 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19 cancel-in-progress: true
20
21permissions:
22 pull-requests: read
23 contents: read
24
25env:
26
27 ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
28 ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder
29
30jobs:
31 build_package_shell:
32 strategy:
33 fail-fast: false
34 matrix:
35 os: ["ubuntu-latest", "windows-latest", "macos-latest"]
36 version: [22]
37
38 runs-on: ${{ matrix.os }}
39
40 steps:
41 - name: Setup Git LF
42 run: |
43 git config --global core.autocrlf false
44 - uses: actions/checkout@v4
45 - uses: dorny/paths-filter@v3
46 id: filter
47 continue-on-error: true
48 with:
49 filters: |
50 ts:
51 - "ts/**"
52 - ".github/workflows/build-package-shell.yml"
53 - uses: pnpm/action-setup@v4
54 if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }}
55 name: Install pnpm
56 with:
57 package_json_file: ts/package.json
58 - uses: actions/setup-node@v4
59 if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }}
60 with:
61 node-version: ${{ matrix.version }}
62 cache: "pnpm"
63 cache-dependency-path: ts/pnpm-lock.yaml
64 - name: Install dependencies
65 if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }}
66 working-directory: ts
67 run: |
68 pnpm install --frozen-lockfile --strict-peer-dependencies
69 - name: Build
70 if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }}
71 working-directory: ts
72 run: |
73 pnpm run build:shell
74 env:
75 DEBUG_DEMB: true
76 # Reusing the cache can be flaky. If a downloaded archive is corrupted it can cause
77 # problems because github tries to reuse the same machine for the next job leading to
78 # blocked builds. This is a bug in electron-builder, it's not smart enough to retry acquiring the archive.
79 # Disabling for now.
80 # - name: Electron Builder Cache
81 # if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }}
82 # uses: actions/cache@v4
83 # with:
84 # key: electron | ${{ runner.os }} | ${{ runner.arch }} | ${{ hashFiles('**/pnpm-lock.yaml') }}
85 # path: |
86 # ${{ env.ELECTRON_BUILDER_CACHE }}
87 # ${{ env.ELECTRON_CACHE }}
88 # restore-keys: |
89 # electron | ${{ runner.os }} | ${{ runner.arch }}
90 - name: Package - shell
91 if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }}
92 working-directory: ts
93 shell: bash
94 run: pnpm run shell:package
95
96 # - uses: actions/upload-artifact@v4
97 # if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts != 'false' }}
98 # name: Upload build artifact
99 # with:
100 # name: typeagent-shell-${{ matrix.os }}-${{ github.run_number }}
101 # path: ts/packages/shell/dist/** # files/dirs to include
102 # retention-days: 7
103
104