Skip to content

Fixing github workflow #40

Fixing github workflow

Fixing github workflow #40

Workflow file for this run

name: Deploy on release
on:
push:
tags:
- "[0-9]*"
- "test*"
branches:
- "ci-test"
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml-compiler:
- "5.2"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- run: echo "GITHUB_TAG=$(git describe --always --tags)" >> $GITHUB_ENV
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: echo "OS_SHORT_NAME=linux" >> $GITHUB_ENV
- if: ${{ startsWith(matrix.os, 'macos') }}
run: echo "OS_SHORT_NAME=macos" >> $GITHUB_ENV
- if: ${{ startsWith(matrix.os, 'windows') }}
run: echo "OS_SHORT_NAME=windows" >> $GITHUB_ENV
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- run: opam install --locked .
- name: Create build
if: ${{ env.OS_SHORT_NAME == 'macos' }}
run: |
opam exec -- make release-build
- name: Create static build
if: ${{ env.OS_SHORT_NAME == 'linux' || env.OS_SHORT_NAME == 'windows' }}
run: |
opam exec -- make release-static-build
- name: Package into tar.gz
run: |
mv release/docfd docfd
tar -cvzf docfd-${{ env.GITHUB_TAG }}-${{ env.OS_SHORT_NAME }}.tar.gz docfd
- name: Upload artifacts
if: ${{ github.ref_name == 'ci-test' }}
uses: actions/upload-artifact@v4
with:
name: docfd-${{ env.GITHUB_TAG }}-${{ env.OS_SHORT_NAME }}.tar.gz
path: docfd-${{ env.GITHUB_TAG }}-${{ env.OS_SHORT_NAME }}.tar.gz
- name: Release
if: ${{ github.ref_name != 'ci-test' }}
uses: softprops/action-gh-release@v1
with:
files: |
docfd-${{ env.GITHUB_TAG }}-${{ env.OS_SHORT_NAME }}.tar.gz