on master help sign in
Build and release htmlang-lsp alongside htmlang for all platforms
a9313d2iko
.github/workflows/release.yml+20−8
@@ -15,15 +15,19 @@ jobs:
15 - os: ubuntu-latest
15 - os: ubuntu-latest
16 target: x86_64-unknown-linux-gnu
16 target: x86_64-unknown-linux-gnu
17 name: htmlang-linux-x86_64
17 name: htmlang-linux-x86_64
18+ lsp_name: htmlang-lsp-linux-x86_64
18 - os: macos-latest
19 - os: macos-latest
19 target: x86_64-apple-darwin
20 target: x86_64-apple-darwin
20 name: htmlang-macos-x86_64
21 name: htmlang-macos-x86_64
22+ lsp_name: htmlang-lsp-macos-x86_64
21 - os: macos-latest
23 - os: macos-latest
22 target: aarch64-apple-darwin
24 target: aarch64-apple-darwin
23 name: htmlang-macos-aarch64
25 name: htmlang-macos-aarch64
26+ lsp_name: htmlang-lsp-macos-aarch64
24 - os: windows-latest
27 - os: windows-latest
25 target: x86_64-pc-windows-msvc
28 target: x86_64-pc-windows-msvc
26 name: htmlang-windows-x86_64.exe
29 name: htmlang-windows-x86_64.exe
30+ lsp_name: htmlang-lsp-windows-x86_64.exe
27 steps:
31 steps:
28 - uses: actions/checkout@v4
32 - uses: actions/checkout@v4
29
33
@@ -31,22 +35,30 @@ jobs:
31 with:
35 with:
32 targets: ${{ matrix.target }}
36 targets: ${{ matrix.target }}
33
37
34− - name: Build binary
38+ - name: Build binaries
35 run: cargo build --release --target ${{ matrix.target }}
39 run: cargo build --release --target ${{ matrix.target }}
36
40
37− - name: Strip binary (Unix)
41+ - name: Strip binaries (Unix)
38 if: runner.os != 'Windows'
42 if: runner.os != 'Windows'
39 run: |
43 run: |
44+ for bin in htmlang htmlang-lsp; do
40− if [ -f target/${{ matrix.target }}/release/htmlang ]; then
45+ if [ -f target/${{ matrix.target }}/release/$bin ]; then
41− strip target/${{ matrix.target }}/release/htmlang
46+ strip target/${{ matrix.target }}/release/$bin
42− fi
47+ fi
48+ done
43
49
44− - name: Upload artifact
50+ - name: Upload htmlang
45 uses: actions/upload-artifact@v4
51 uses: actions/upload-artifact@v4
46 with:
52 with:
47 name: ${{ matrix.name }}
53 name: ${{ matrix.name }}
48 path: target/${{ matrix.target }}/release/htmlang${{ runner.os == 'Windows' && '.exe' || '' }}
54 path: target/${{ matrix.target }}/release/htmlang${{ runner.os == 'Windows' && '.exe' || '' }}
49
55
56+ - name: Upload htmlang-lsp
57+ uses: actions/upload-artifact@v4
58+ with:
59+ name: ${{ matrix.lsp_name }}
60+ path: target/${{ matrix.target }}/release/htmlang-lsp${{ runner.os == 'Windows' && '.exe' || '' }}
61+
50 release:
62 release:
51 name: Create Release
63 name: Create Release
52 needs: build
64 needs: build
@@ -74,8 +86,8 @@ jobs:
74 for dir in artifacts/*/; do
86 for dir in artifacts/*/; do
75 filename=$(basename "$dir")
87 filename=$(basename "$dir")
76 binary=$(find "$dir" -type f -executable | head -1)
88 binary=$(find "$dir" -type f -executable | head -1)
77− if [ -z "$binary" ] && [ -f "$dir/htmlang.exe" ]; then
89+ if [ -z "$binary" ]; then
78− binary="$dir/htmlang.exe"
90+ binary=$(find "$dir" -type f -name "*.exe" | head -1)
79 fi
91 fi
80 if [ -n "$binary" ]; then
92 if [ -n "$binary" ]; then
81 cp "$binary" "release/$filename"
93 cp "$binary" "release/$filename"