-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (122 loc) · 4.55 KB
/
Copy pathrelease.yml
File metadata and controls
149 lines (122 loc) · 4.55 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Release - Lya Code
# Runs on:
# - push of a v*.*.* tag
# - manual workflow_dispatch with a tag
#
# Publishes installer artifacts to StudioCodeAI/LyaCode-installers.
# Required secret:
# - INSTALLERS_REPO_TOKEN: PAT with Contents read/write on StudioCodeAI/LyaCode-installers.
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag, for example v1.0.8'
required: true
type: string
permissions:
contents: read
jobs:
build-and-release:
name: Build and release
runs-on: windows-latest
steps:
- name: Resolve release tag
id: release_tag
shell: pwsh
run: |
if ("${{ github.event_name }}" -eq "workflow_dispatch") {
$tag = "${{ inputs.tag }}"
} else {
$tag = "${{ github.ref_name }}"
}
if (-not $tag.StartsWith("v")) {
throw "Release tag must start with v. Received: $tag"
}
"tag=$tag" >> $env:GITHUB_OUTPUT
Write-Host "Release tag: $tag"
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ steps.release_tag.outputs.tag }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build CLI
run: bun run build
- name: Create npm tarball
run: npm pack
- name: Build Windows installer
run: bun run build:installer:windows
- name: Detect package version
id: version
shell: pwsh
run: |
$version = (Get-Content package.json | ConvertFrom-Json).version
$expectedTag = "v$version"
if ($expectedTag -ne "${{ steps.release_tag.outputs.tag }}") {
throw "package.json version $version does not match release tag ${{ steps.release_tag.outputs.tag }}"
}
"version=$version" >> $env:GITHUB_OUTPUT
Write-Host "Version detected: $version"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: lyacode-release-${{ steps.version.outputs.version }}
path: |
dist/installer/*
studiocodeai-lyacode-*.tgz
- name: Publish installers release
uses: softprops/action-gh-release@v2
with:
name: Lya Code v${{ steps.version.outputs.version }}
tag_name: ${{ steps.release_tag.outputs.tag }}
repository: StudioCodeAI/LyaCode-installers
token: ${{ secrets.INSTALLERS_REPO_TOKEN }}
generate_release_notes: false
fail_on_unmatched_files: false
files: |
dist/installer/lyacode-setup-x64-*.exe
dist/installer/lyacode-portable-*.zip
studiocodeai-lyacode-*.tgz
body: |
## Lya Code v${{ steps.version.outputs.version }}
Terminal agentic da Studio CodeAI para workflows de codigo local e em nuvem.
### Instalacao via npm
```bash
npm install -g https://github.com/StudioCodeAI/LyaCode-installers/releases/download/${{ steps.release_tag.outputs.tag }}/studiocodeai-lyacode-${{ steps.version.outputs.version }}.tgz
```
### Windows Portable
```powershell
irm https://github.com/StudioCodeAI/LyaCode-installers/releases/download/${{ steps.release_tag.outputs.tag }}/lyacode-portable-${{ steps.version.outputs.version }}.zip -OutFile lyacode-portable.zip
Expand-Archive lyacode-portable.zip -DestinationPath .\lyacode-portable -Force
cd lyacode-portable
.\install.cmd
```
### Windows Installer
```powershell
irm https://github.com/StudioCodeAI/LyaCode-installers/releases/download/${{ steps.release_tag.outputs.tag }}/lyacode-setup-x64-${{ steps.version.outputs.version }}.exe -OutFile lyacode-setup.exe
.\lyacode-setup.exe
```
### Validacao
```bash
lya --version
lyacode --version
lscode --version
```
### Desinstalar
```bash
npm uninstall -g @studiocodeai/lyacode
```
Codigo-fonte: repositorio privado StudioCodeAI/LyaCode.
Releases publicas: StudioCodeAI/LyaCode-installers.