Skip to content

[CI] GitHub Actions "release" workflow #5

[CI] GitHub Actions "release" workflow

[CI] GitHub Actions "release" workflow #5

Workflow file for this run

name: Build & Release
on:
push:
branches: ["master"]
pull_request:
jobs:
build:
name: Build
runs-on: ${{ matrix.build.os }}
strategy:
fail-fast: false
matrix:
build:
- {
NAME: linux-x64,
OS: ubuntu-22.04,
TARGET: x86_64-unknown-linux-gnu,
}
- {
NAME: windows-x64,
OS: windows-2022,
TARGET: x86_64-pc-windows-msvc,
}
- {
NAME: windows-arm64,
OS: windows-2022,
TARGET: aarch64-pc-windows-msvc,
}
- {
NAME: darwin-x64,
OS: macos-12,
TARGET: x86_64-apple-darwin,
}
- {
NAME: darwin-arm64,
OS: macos-12,
TARGET: aarch64-apple-darwin,
}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust env
uses: "./.github/actions/setup-rust-env"
- name: Build
run: cargo build --release --locked --target ${{ matrix.build.TARGET }}
- name: Rename htmx-lsp binary
shell: bash
run: |
binary_name="htmx-lsp"
extension=""
# windows binaries have ".exe" extension
if [[ "${{ matrix.build.OS }}" == *"windows"* ]]; then
extension=".exe"
fi
mkdir bin
cp "target/${{ matrix.build.TARGET }}/release/${binary_name}" "bin/${binary_name}-${{ matrix.build.NAME }}${extension}"
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: built-binaries
path: bin/*