Skip to content

Commit d76e2ee

Browse files
committed
add github action
1 parent 03dafd9 commit d76e2ee

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: main
2+
3+
env:
4+
PACKAGE_NAME: "mcp-server-drupal"
5+
TARGET_LIST: "bun-linux-x64-modern,bun-linux-arm64,bun-windows-x64-modern,bun-darwin-arm64,bun-darwin-x64"
6+
7+
on:
8+
push:
9+
pull_request:
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: oven-sh/setup-bun@v2
17+
18+
- run: bun install
19+
- run: bun run biome ci --reporter=github
20+
21+
build-and-release:
22+
runs-on: ubuntu-latest
23+
needs: lint
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: oven-sh/setup-bun@v2
27+
28+
- name: get-npm-version
29+
id: package-version
30+
uses: martinbeentjes/[email protected]
31+
32+
- run: bun install
33+
- run: |
34+
for target in $(echo $TARGET_LIST | tr "," "\n")
35+
do
36+
binary_name=$(echo $target | sed "s/^bun-/$PACKAGE_NAME-${{ steps.package-version.outputs.current-version}}/" | sed "s/-/_/g")
37+
bun build --compile --target=$target --minify --sourcemap --bytecode ./src/index.ts --outfile ./build/$binary_name
38+
done
39+
- name: Release
40+
uses: softprops/action-gh-release@v2
41+
if: startsWith(github.ref, 'refs/tags/')
42+
with:
43+
files: |
44+
build/*

0 commit comments

Comments
 (0)