-
Notifications
You must be signed in to change notification settings - Fork 3
144 lines (123 loc) · 4.09 KB
/
Copy pathcd.yml
File metadata and controls
144 lines (123 loc) · 4.09 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
name: CD - Build and Release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
name: Build binaries
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x64
extension: ''
- os: ubuntu-22.04-arm
platform: linux
arch: arm64
extension: ''
- os: macos-13
platform: darwin
arch: x64
extension: ''
- os: macos-latest
platform: darwin
arch: arm64
extension: ''
- os: windows-latest
platform: win32
arch: x64
extension: '.exe'
# not yet supported by bun
# - os: windows-11-arm
# platform: win32
# arch: arm64
# extension: '.exe'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.2.17'
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Create bin directory
run: mkdir -p bin
- name: Build binary
run: bun build --compile --minify --sourcemap src/index.ts --outfile bin/lsh${{ matrix.extension }}
- name: Make binary executable (Unix)
if: matrix.os != 'windows-latest'
run: chmod +x bin/lsh
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: lsh-${{ matrix.platform }}-${{ matrix.arch }}
path: bin/lsh${{ matrix.extension }}
# release
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Prepare release assets
run: |
mkdir -p release
# Rename and move binaries with proper names
mv artifacts/lsh-linux-x64/lsh release/lsh-linux-x64
mv artifacts/lsh-linux-arm64/lsh release/lsh-linux-arm64
mv artifacts/lsh-darwin-x64/lsh release/lsh-darwin-x64
mv artifacts/lsh-darwin-arm64/lsh release/lsh-darwin-arm64
mv artifacts/lsh-win32-x64/lsh.exe release/lsh-win32-x64.exe
# Create checksums
cd release
sha256sum lsh-* > checksums.txt
ls -la
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: Release ${{ steps.version.outputs.version }}
body: |
## LazyShell ${{ steps.version.outputs.version }}
### Downloads
- **Linux (x64)**: `lsh-linux-x64`
- **Linux (ARM64)**: `lsh-linux-arm64`
- **macOS (x64)**: `lsh-darwin-x64`
- **macOS (ARM64)**: `lsh-darwin-arm64`
- **Windows (x64)**: `lsh-win32-x64.exe`
### Installation
1. Download the appropriate binary for your platform
2. Make it executable: `chmod +x lsh-*` (Unix systems)
3. Move to a directory in your PATH: `mv lsh-* /usr/local/bin/lsh`
4. Run: `lsh --help`
### Checksums
SHA256 checksums are included in `checksums.txt` for verification.
files: |
release/lsh-linux-x64
release/lsh-linux-arm64
release/lsh-darwin-x64
release/lsh-darwin-arm64
release/lsh-win32-x64.exe
release/checksums.txt
draft: false
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}