Skip to content

Statically link ocamlformat-rpc (#4) #3

Statically link ocamlformat-rpc (#4)

Statically link ocamlformat-rpc (#4) #3

Workflow file for this run

name: Build
on:
push:
tags:
- '*'
jobs:
ocamlformat:
name: Build ocamlformat binaries
permissions:
contents: write
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14]
ocaml: ["5.2.0"]
include:
- os: ubuntu-latest
version: "0.26.2"
linking: static
target_triple: x86_64-unknown-linux-musl
- os: macos-13
version: "0.26.2"
linking: dynamic
target_triple: x86_64-apple-darwin
- os: macos-14
version: "0.26.2"
linking: dynamic
target_triple: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Set archive environment variables
run: |
echo "FLAKE_NAME=./flakes/ocamlformat/#ocamlformat_$(echo ${{ matrix.version }} | tr . _)_ocaml_$(echo ${{ matrix.ocaml }} | tr . _)_${{ matrix.linking }}" >> $GITHUB_ENV
echo "ARCHIVE_NAME=ocamlformat.${{ matrix.version }}+binary-ocaml-${{ matrix.ocaml }}-built-${{ github.ref_name }}-${{ matrix.target_triple }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- name: Build ocamlformat
run: |
nix build $FLAKE_NAME
mkdir -p $ARCHIVE_NAME
cp -r result/* $ARCHIVE_NAME
cp -r flakes/ocamlformat/static/* $ARCHIVE_NAME
find $ARCHIVE_NAME -type d -exec chmod +w {} +
tar --format=posix -cvf $ARCHIVE_NAME.tar $ARCHIVE_NAME
gzip -9 $ARCHIVE_NAME.tar
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "*.tar.gz"
ocaml-lsp-server:
name: Build ocaml-lsp-server binaries
permissions:
contents: write
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14]
ocaml: ["5.2.0", "5.1.1"]
include:
- os: ubuntu-latest
version: "1.19.0"
ocaml: "5.2.0"
linking: static
target_triple: x86_64-unknown-linux-musl
- os: macos-13
version: "1.19.0"
ocaml: "5.2.0"
linking: dynamic
target_triple: x86_64-apple-darwin
- os: macos-14
version: "1.19.0"
ocaml: "5.2.0"
linking: dynamic
target_triple: aarch64-apple-darwin
- os: ubuntu-latest
version: "1.18.0"
ocaml: "5.1.1"
linking: static
target_triple: x86_64-unknown-linux-musl
- os: macos-13
version: "1.18.0"
ocaml: "5.1.1"
linking: dynamic
target_triple: x86_64-apple-darwin
- os: macos-14
version: "1.18.0"
ocaml: "5.1.1"
linking: dynamic
target_triple: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Set archive environment variables
run: |
echo "FLAKE_NAME=./flakes/ocaml-lsp-server/#ocaml_lsp_server_$(echo ${{ matrix.version }} | tr . _)_ocaml_$(echo ${{ matrix.ocaml }} | tr . _)_${{ matrix.linking }}" >> $GITHUB_ENV
echo "ARCHIVE_NAME=ocaml-lsp-server.${{ matrix.version }}+binary-ocaml-${{ matrix.ocaml }}-built-${{ github.ref_name }}-${{ matrix.target_triple }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
- name: Build ocaml-lsp-server
run: |
nix build $FLAKE_NAME
mkdir -p $ARCHIVE_NAME
cp -r result/* $ARCHIVE_NAME
cp -r flakes/ocaml-lsp-server/static/* $ARCHIVE_NAME
find $ARCHIVE_NAME -type d -exec chmod +w {} +
tar --format=posix -cvf $ARCHIVE_NAME.tar $ARCHIVE_NAME
gzip -9 $ARCHIVE_NAME.tar
- uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "*.tar.gz"