Upgrade winget manifest #86
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Suggested filename: .github/workflows/build-with-dkml.yml | |
name: Build installer with DkML compiler | |
env: | |
PROGRAM_NAME_KEBAB: diskuv-ocaml | |
DKML_COMPILER: "" # You can override the dkml-compiler package version. Example: 4.12.1-v1.0.2, 4.14.0-v1.1.0-prerel1 | |
OPAM_PACKAGE: dkml-installer-ocaml-network | |
on: | |
push: | |
branches: | |
- main | |
- v* | |
tags: | |
- v* | |
# ... or trigger manually from GitHub web interface | |
workflow_dispatch: | |
inputs: | |
test-filter: | |
type: choice | |
description: "Which tests are used" | |
required: false | |
default: all-tests | |
options: | |
- "all-tests" | |
- "no-tests" | |
- "no-direct-tests" | |
- "no-vagrant-tests" | |
jobs: | |
build: | |
timeout-minutes: 90 # 1.5 hours | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- gh_os: windows-2019 | |
abi_pattern: win32-windows_x86 | |
dkml_host_abi: windows_x86 | |
- gh_os: windows-2019 | |
abi_pattern: win32-windows_x86_64 | |
dkml_host_abi: windows_x86_64 | |
# - gh_os: ubuntu-latest | |
# abi_pattern: manylinux2014-linux_x86 | |
# dkml_host_abi: linux_x86 | |
# - gh_os: ubuntu-latest | |
# abi_pattern: manylinux2014-linux_x86_64 | |
# dkml_host_abi: linux_x86_64 | |
# - gh_os: macos-latest | |
# abi_pattern: macos-darwin_all | |
# dkml_host_abi: darwin_x86_64 | |
runs-on: ${{ matrix.gh_os }} | |
name: build / ${{ matrix.abi_pattern }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# The Setup DKML action will create the environment variables: | |
# opam_root, exe_ext, dkml_host_abi, abi_pattern (and many more) | |
- name: Setup DKML on a Windows host | |
if: startsWith(matrix.dkml_host_abi, 'windows_') | |
uses: ./ci/setup-dkml/gh-windows/pre | |
with: | |
DKML_COMPILER: ${{ env.DKML_COMPILER }} | |
- name: Setup DKML on a Darwin host | |
if: startsWith(matrix.dkml_host_abi, 'darwin_') | |
uses: ./ci/setup-dkml/gh-darwin/pre | |
with: | |
DKML_COMPILER: ${{ env.DKML_COMPILER }} | |
- name: Setup DKML on a Linux host | |
if: startsWith(matrix.dkml_host_abi, 'linux_') | |
uses: ./ci/setup-dkml/gh-linux/pre | |
with: | |
DKML_COMPILER: ${{ env.DKML_COMPILER }} | |
# This section is for your own build logic which you should place in ci/build-test.sh or a similar file | |
- name: Build and test the package on Windows host | |
if: startsWith(matrix.dkml_host_abi, 'windows_') | |
shell: msys2 {0} | |
# with: | |
# DKML_HOST_ABI: ${{ matrix.dkml_host_abi }} | |
run: ci/build-test.sh --opam-package=${{ env.OPAM_PACKAGE }} --program-name-kebab=${{ env.PROGRAM_NAME_KEBAB }} | |
- name: Build and test the package on non-Windows host | |
if: "!startsWith(matrix.dkml_host_abi, 'windows_')" | |
# with: | |
# DKML_HOST_ABI: ${{ matrix.dkml_host_abi }} | |
run: ci/build-test.sh --opam-package=${{ env.OPAM_PACKAGE }} --program-name-kebab=${{ env.PROGRAM_NAME_KEBAB }} | |
# The Teardown DKML action will finalize caching, etc. | |
- name: Teardown DKML on a Windows host | |
if: startsWith(matrix.dkml_host_abi, 'windows_') | |
uses: ./ci/setup-dkml/gh-windows/post | |
- name: Teardown DKML on a Darwin host | |
if: startsWith(matrix.dkml_host_abi, 'darwin_') | |
uses: ./ci/setup-dkml/gh-darwin/post | |
- name: Teardown DKML on a Linux host | |
if: startsWith(matrix.dkml_host_abi, 'linux_') | |
uses: ./ci/setup-dkml/gh-linux/post | |
# We'll capture the dist/ folder for the testing steps | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.dkml_host_abi }} | |
path: dist/ | |
release-notes: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout installer code | |
uses: actions/checkout@v3 | |
- name: Decode opam version of installer | |
run: | | |
# (version 1.0.1) -> 1.0.1 | |
OPAMMAJMINPAT=$(awk '$1 == "(version" {sub(/)/,"",$2); print $2}' dune-project) | |
echo "OPAMMAJMINPAT=$OPAMMAJMINPAT" >> $GITHUB_ENV | |
- name: Decode semver versions of CI tag | |
run: | | |
# From refs/tags/v0.4.0-prerel91_r1_no_test -> 0.4.0 | |
# From refs/tags/v0.4.0+something -> 0.4.0 | |
MAJMINPAT=$(printf "%s" '${{ github.ref }}' | sed 's#refs/tags/##; s#^v##; s#-.*##; s#+.*##') | |
# From refs/tags/v0.4.0-prerel91_r1_no_test -> 0.4.0-prerel91 | |
# From refs/tags/v0.4.0+something -> 0.4.0 | |
MAJMINPATPRE=$(printf "%s" '${{ github.ref }}' | sed 's#refs/tags/##; s#^v##; s#\(-prerel[0-9]*\).*#\1#; s#+.*##') | |
echo "MAJMINPAT=$MAJMINPAT" >> $GITHUB_ENV | |
echo "MAJMINPATPRE=$MAJMINPATPRE" >> $GITHUB_ENV | |
printf 'Major.Minor.Patch = \e[1;34m%s\e[0m\n' "$MAJMINPAT" | |
printf 'Major.Minor.Patch[-Prerelease] = \e[1;34m%s\e[0m\n' "$MAJMINPATPRE" | |
- name: Checkout diskuv-ocaml at semver tags | |
run: | | |
git clone https://gitlab.com/dkml/distributions/dkml.git | |
if ! git -C dkml -c advice.detachedHead=false checkout "${MAJMINPATPRE}"; then | |
# If there is no prerelease tag, perhaps there is a maj/min/patch tag? | |
if ! git -C dkml -c advice.detachedHead=false checkout "${MAJMINPAT}"; then | |
# If there is no maj/min/patch tag, don't let next step grab notes from HEAD | |
rm -rf dkml | |
fi | |
fi | |
- name: View release notes | |
run: | | |
notes=diskuv-ocaml/contributors/changes/v${MAJMINPAT}.md | |
cat > footer-top.md <<EOF | |
## Asset Listing | |
| Asset | Supported? | Description | | |
| ----------------------------------------------------- | ---------- | ----------------------------------------------------------------------------------- | | |
EOF | |
cat > footer-mid-prerelease.md <<EOF | |
| [unsigned-diskuv-ocaml-windows_x86_64-i-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/unsigned-diskuv-ocaml-windows_x86_64-i-$OPAMMAJMINPAT.exe) | Yes | Unsigned 64-bit OCaml distribution installer. **You should download+install this** | | |
| [unsigned-diskuv-ocaml-windows_x86-i-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/unsigned-diskuv-ocaml-windows_x86-i-$OPAMMAJMINPAT.exe) | Partial | Unsigned 32-bit OCaml distribution on 64-bit Windows. Some OCaml packages may have problems | | |
| [unsigned-diskuv-ocaml-windows_x86_64-u-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/unsigned-diskuv-ocaml-windows_x86_64-u-$OPAMMAJMINPAT.exe) | Yes | Unsigned 64-bit OCaml distribution uninstaller. Use this if support@ tells you | | |
| [unsigned-diskuv-ocaml-windows_x86-u-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/unsigned-diskuv-ocaml-windows_x86-u-$OPAMMAJMINPAT.exe) | Partial | Unsigned 32-bit OCaml distribution uninstaller | | |
EOF | |
cat > footer-mid-release.md <<EOF | |
| [setup-diskuv-ocaml-windows_x86_64-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/setup-diskuv-ocaml-windows_x86_64-$OPAMMAJMINPAT.exe) | Yes | 64-bit OCaml distribution installer. **You should download+install this** | | |
| [setup-diskuv-ocaml-windows_x86-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/setup-diskuv-ocaml-windows_x86-$OPAMMAJMINPAT.exe) | Partial | 32-bit OCaml distribution on 64-bit Windows. Some OCaml packages may have problems | | |
| [uninstall-diskuv-ocaml-windows_x86_64-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/uninstall-diskuv-ocaml-windows_x86_64-$OPAMMAJMINPAT.exe) | Yes | 64-bit OCaml distribution uninstaller. Use this if support@ tells you | | |
| [uninstall-diskuv-ocaml-windows_x86-$OPAMMAJMINPAT.exe](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/uninstall-diskuv-ocaml-windows_x86-$OPAMMAJMINPAT.exe) | Partial | 32-bit OCaml distribution uninstaller | | |
EOF | |
cat > footer-bottom.md <<EOF | |
| [diskuv-ocaml-darwin_x86_64-i-$OPAMMAJMINPAT.tar.gz](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/diskuv-ocaml-darwin_x86_64-i-$OPAMMAJMINPAT.tar.gz) | No | Unsigned macOS on Intel binary distribution | | |
| [diskuv-ocaml-linux_x86_64-i-$OPAMMAJMINPAT.tar.gz](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/diskuv-ocaml-linux_x86_64-i-$OPAMMAJMINPAT.tar.gz) | No | Linux distribution compatible with CentOS 7, CentOS 8, Fedora 32+, Mageia 8+, ... | | |
| [diskuv-ocaml-linux_x86-i-$OPAMMAJMINPAT.tar.gz](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/diskuv-ocaml-linux_x86-i-$OPAMMAJMINPAT.tar.gz) | No | ... openSUSE 15.3+, Photon OS 4.0+ (3.0+ with updates), Ubuntu 20.04+Linux | | |
| [diskuv-ocaml-windows_x86-i-$OPAMMAJMINPAT.sfx](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/diskuv-ocaml-windows_x86-i-$OPAMMAJMINPAT.sfx) | No | Self-extracting executable header used when creating signed installers from ... | | |
| [diskuv-ocaml-windows_x86_64-i-$OPAMMAJMINPAT.sfx](https://github.com/diskuv/dkml-installer-ocaml/releases/download/v${MAJMINPATPRE}/diskuv-ocaml-windows_x86_64-i-$OPAMMAJMINPAT.sfx) | No | ... the pk7zip contents of the unsigned Windows installers | | |
| *-u-$OPAMMAJMINPAT.* | No | Uninstallers for all the above | | |
EOF | |
echo > emptyline | |
if [ -e "$notes" ]; then | |
RELEASEDATE=$(date -u +%Y-%m-%d) | |
cat "$notes" emptyline footer-top.md footer-mid-prerelease.md footer-bottom.md | sed "s/@@YYYYMMDD@@/$RELEASEDATE/" > notes-prerelease.md | |
cat "$notes" emptyline footer-top.md footer-mid-release.md footer-bottom.md | sed "s/@@YYYYMMDD@@/$RELEASEDATE/" > notes-release.md | |
else | |
cat footer-top.md footer-mid-prerelease.md footer-bottom.md > notes-prerelease.md | |
cat footer-top.md footer-mid-release.md footer-bottom.md > notes-release.md | |
fi | |
tail -n200 notes-prerelease.md notes-release.md # Just for troubleshooting | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: release-notes | |
path: | | |
notes-prerelease.md | |
notes-release.md | |
# Vagrant testing uncovers bugs that only appear on a fresh Windows installation. | |
# For example, found missing vcruntime140.dll with Vagrant testing. | |
# | |
# However Vagrant uses UNC paths for its shared drive which sometimes gets | |
# resolved as \\xxx\y rather than C:\vagrant. UNC paths are not supported well | |
# in OCaml ecosystem. So we only test the installer and uninstaller and some | |
# very light Dune-based tests in Vagrant. | |
vagrant-testing: | |
timeout-minutes: 180 # 3.0 hours | |
if: | | |
github.event.inputs.test-filter != 'no-tests' && | |
github.event.inputs.test-filter != 'no-vagrant-tests' && | |
!endsWith(github.ref_name, '_no_test') | |
# Wait for build | |
needs: | |
- build | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-2019] | |
dkml_host_abi: | |
- windows_x86 | |
- windows_x86_64 | |
virtualbox: | |
- windows-10-enterprise | |
# - windows-10-21h2-enterprise | |
# - windows-10-22h2-enterprise-nocm | |
- windows-11-21h2-enterprise | |
# macOS-12 is only GitHub CI runner that supports VirtualBox | |
# - the suggested 10.15 from https://stackoverflow.com/questions/66261101/using-vagrant-on-github-actions-ideally-incl-virtualbox | |
# is deprecated (https://github.com/actions/runner-images/issues/5583) | |
# - virtualbox added to macOS-12 in https://github.com/actions/runner-images/pull/5594 | |
runs-on: macos-12 | |
name: vagrant / ${{ matrix.dkml_host_abi }} / ${{ matrix.virtualbox }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download and unpack ${{ matrix.dkml_host_abi }} artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.dkml_host_abi }} | |
path: dist | |
- name: Cache Vagrant boxes | |
uses: actions/cache@v3 | |
with: | |
path: ~/.vagrant.d/boxes | |
key: ${{ runner.os }}-vagrant-${{ hashFiles('vagrant/win32/Vagrantfile') }} | |
restore-keys: | | |
${{ runner.os }}-vagrant- | |
- name: Sanitize | |
run: rm -rf ~/playground | |
- name: vagrant up for ${{ matrix.dkml_host_abi }} build | |
run: | | |
#!/bin/sh | |
set -eufx | |
awk 'BEGIN{FS="="} /let +arp_version *= */{print $NF}' installer/src/version.ml | tr -d '"' | tee vagrant/win32/arpversion.txt | |
# Move artifacts into the Vagrant filesystem as "setup.exe" and "uninstall.exe" | |
mv dist/unsigned-${PROGRAM_NAME_KEBAB}-${{matrix.dkml_host_abi}}-i-$(cat vagrant/win32/arpversion.txt).exe vagrant/win32/setup.exe | |
mv dist/unsigned-${PROGRAM_NAME_KEBAB}-${{matrix.dkml_host_abi}}-u-$(cat vagrant/win32/arpversion.txt).exe vagrant/win32/uninstall.exe | |
cd vagrant/win32 | |
vagrant up "${{ matrix.dkml_host_abi }}-${{ matrix.virtualbox }}" | |
- name: Check test_installation.t status | |
run: | | |
set -x ; EXITC=$(awk 'NF>0{print $1}' vagrant/win32/test_installation.t/exitcode.en-US.txt) ; if [ ! "$EXITC" = 0 ]; then echo "FATAL: Vagrant test_installation.t FAILED with exit code $EXITC"; exit 1; fi | |
- name: Get EstimatedSize= for Windows registry | |
run: | | |
cat vagrant/win32/test_installation.t/estimatedsize.en-US.txt | |
# Direct testing is simply using GitHub virtual machine to run the setup. | |
# | |
# Pros and Cons | |
# Because GitHub virtual machine already has Visual Studio and several other | |
# tools, it doesn't exercise all the paths that vagrant-testing covers. | |
# However, it is quicker and it can find issues with conflicting Cygwin | |
# (or any other of the many programs that are installed on a GitHub machine). | |
# In addition, windows-2019 (somewhat older Windows) and windows-latest (2022, or | |
# which is the latest) is tested ... Vagrant is closer to windows-latest | |
# as of Apr 2022. | |
# | |
# Matrix | |
# Instead of all 4 combinations of (2019,latest) x (32bit,64bit), we half | |
# the matrix so save compute cycles. | |
# | |
# Tricky Issues | |
# [Git installer hangs] | |
# | |
# The move for both windows-2019 and windows-latest from | |
# Image Release: https://github.com/actions/virtual-environments/releases/tag/win19%2F20220606.1 | |
# to: | |
# Image Release: https://github.com/actions/virtual-environments/releases/tag/win19%2F20220614.0 | |
# causes the Git for Windows 2.36.0 installer to hang. | |
# | |
# Root cause? It is likely antivirus | |
# (https://github.com/git-for-windows/msys2-runtime/pull/37) or a slightly | |
# different UAC environment. | |
# | |
# Mitigation: Pre-install Git for Windows from Chocolatey. Also Vagrant still | |
# tests the Git installer successfully. | |
direct-testing: | |
# Disabled until "Tricky Issues" is fixed | |
#if: false | |
if: | | |
github.event.inputs.test-filter != 'no-tests' && | |
github.event.inputs.test-filter != 'no-direct-tests' && | |
!endsWith(github.ref_name, '_no_test') | |
timeout-minutes: 90 # 1.5 hours | |
# Wait for build | |
needs: | |
- build | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-2019 | |
dkml_host_abi: windows_x86 | |
- os: windows-latest | |
dkml_host_abi: windows_x86_64 | |
runs-on: ${{ matrix.os }} | |
name: direct / ${{ matrix.os }} ${{ matrix.dkml_host_abi }} | |
steps: | |
- name: Download and unpack ${{ matrix.dkml_host_abi }} artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ matrix.dkml_host_abi }} | |
path: dist | |
- name: Troubleshoot environment (Windows) | |
shell: pwsh | |
run: | | |
dir env: | |
get-command git | |
echo dir "C:\Program Files\git\bin" | |
dir "C:\Program Files\git\bin" | |
echo dir "C:\Program Files\git\cmd" | |
dir "C:\Program Files\git\cmd" | |
- name: Test the installer (Windows) | |
env: | |
# Fix PATH so that `C:\Program Files\Git\usr\bin\cygpath.exe` and | |
# `C:\Program Files\Git\bin\bash.exe` are gone. GitHub Actions | |
# seems to put Git Bash entirely in the PATH! | |
PATH: "C:\\Program Files\\PowerShell\\7;\ | |
C:\\ProgramData\\chocolatey\\bin;\ | |
C:\\Program Files (x86)\\NSIS\\;\ | |
C:\\tools\\zstd;\ | |
C:\\Program Files\\git\\cmd;\ | |
C:\\Program Files\\dotnet;\ | |
C:\\Windows\\system32;\ | |
C:\\Windows;\ | |
C:\\Windows\\System32\\Wbem;\ | |
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;\ | |
C:\\Program Files\\Docker;\ | |
C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit" | |
# If we don't change the shell then msys2/setup-msys2@v2 will conflict with | |
# the dkml-component-unixutils' MSYS2 ... you get: | |
# *** fatal error - cygheap base mismatch detected - 0x180348408/0x180349408. | |
# This problem is probably due to using incompatible versions of the cygwin DLL. | |
shell: pwsh | |
run: | | |
# Avoid Git installer hanging by pre-installing Git. | |
# (Choco best practices: https://docs.chocolatey.org/en-us/choco/commands/#scripting-integration-best-practices-style-guide) | |
#choco upgrade git -y --no-progress --version="'2.36.1'" | |
# --------- INSTALL --------- | |
$setup = Get-ChildItem -Path dist -Filter "unsigned-${{ env.PROGRAM_NAME_KEBAB }}-${{matrix.dkml_host_abi}}-i-*.exe" | Select-Object -First 1 | |
Write-Host "Running $($setup.FullName) ..." | |
& $setup.FullName -v -v --color=always | |
if ($LastExitCode -ne 0) { throw "setup failed! Exited with $LastExitCode" } | |
& "$env:LOCALAPPDATA\Programs\DiskuvOCaml\usr\bin\ocamlopt.exe" -config | |
if ($LastExitCode -ne 0) { throw "ocamlopt.exe -config failed! Exited with $LastExitCode" } | |
& "$env:LOCALAPPDATA\Programs\DiskuvOCaml\bin\opam.exe" --version | |
if ($LastExitCode -ne 0) { throw "opam.exe --version failed! Exited with $LastExitCode" } | |
& "$env:LOCALAPPDATA\Programs\DiskuvOCaml\bin\opam.exe" var | |
if ($LastExitCode -ne 0) { throw "opam.exe var failed! Exited with $LastExitCode" } | |
# --------- TESTING SWITCH --------- | |
# Refresh the PATH with newly installed User entries | |
$env:Path = [Environment]::GetEnvironmentVariable('PATH', 'User') + [System.IO.Path]::PathSeparator + $env:Path | |
# Mimic $DiskuvOCamlHome | |
$env:DiskuvOCamlHome = "$env:LOCALAPPDATA\Programs\DiskuvOCaml" | |
$opamroot = opam var root | |
Write-Output "Testing otherplayground ..." | |
# Run through a simple playground ... different from the auto-installed 'playground' switch ... | |
# where we can test a new switch being created | |
(Test-Path -Path otherplayground) -or $(New-Item otherplayground -ItemType Directory) | |
Set-Location otherplayground # aka. cd playground | |
$env:DKML_BUILD_TRACE = "ON" # enable tracing | |
$env:DKML_BUILD_TRACE_LEVEL = "2" # verbose trace | |
$env:OCAMLRUNPARAM = "b" # stacktrace on failure | |
dkml init --yes # create switch | |
if ($lastexitcode -ne 0) { throw ("FATAL: dkml init failed") } | |
$env:DKML_BUILD_TRACE = "OFF" # disable tracing | |
$env:DKML_BUILD_TRACE_LEVEL = "0" # no trace | |
opam install graphics --yes # install something with a low number of dependencies, that sufficiently exercises Opam | |
if ($lastexitcode -ne 0) { | |
Write-Output "----- TROUBLESHOOTING: dune-*-*.out ----" | |
Get-ChildItem "$opamroot\log" -Filter "dune-*-*.out" | ForEach-Object { Write-Output "[BEGIN $_]" ; Get-Content $_; Write-Output "[END $_]`n" } | |
throw ("FATAL: opam install graphics failed") | |
} | |
opam install ppx_jane --yes # regression test: https://discuss.ocaml.org/t/ann-diskuv-ocaml-1-x-x-windows-ocaml-installer-no-longer-in-preview/10309/8?u=jbeckford | |
if ($lastexitcode -ne 0) { throw ("FATAL: opam install ppx_jane failed") } | |
opam install pyml --yes # regression test: https://github.com/diskuv/dkml-installer-ocaml/issues/12 | |
if ($lastexitcode -ne 0) { throw ("FATAL: opam install pyml failed") } | |
opam install ocaml-lsp-server merlin --yes # regression test: https://github.com/diskuv/dkml-installer-ocaml/issues/21 | |
if ($lastexitcode -ne 0) { throw ("FATAL: opam install ocaml-lsp-server merlin failed") } | |
opam install ocamlformat --yes | |
if ($lastexitcode -ne 0) { throw ("FATAL: opam install ocamlformat failed") } | |
#opam install yaml --yes # test ctypes (but yaml.3.1.0 fails with same error as supposedly fixed https://github.com/avsm/ocaml-yaml/pull/53) | |
if ($lastexitcode -ne 0) { throw ("FATAL: opam install yaml failed") } | |
Set-Location .. | |
# -------- TEST PACMAN --------- | |
& "$env:LOCALAPPDATA\Programs\DiskuvOCaml\bin\with-dkml.exe" pacman-key --init | |
if ($LastExitCode -ne 0) { throw "pacman-key --init failed! Exited with $LastExitCode" } | |
& "$env:LOCALAPPDATA\Programs\DiskuvOCaml\bin\with-dkml.exe" pacman-key --populate | |
if ($LastExitCode -ne 0) { throw "pacman-key --populate failed! Exited with $LastExitCode" } | |
& "$env:LOCALAPPDATA\Programs\DiskuvOCaml\bin\with-dkml.exe" pacman -Q | |
if ($LastExitCode -ne 0) { throw "pacman -Q failed! Exited with $LastExitCode" } | |
# --------- UNINSTALL --------- | |
$uninstall = Get-ChildItem -Path dist -Filter "unsigned-${{ env.PROGRAM_NAME_KEBAB }}-${{matrix.dkml_host_abi}}-u-*.exe" | Select-Object -First 1 | |
Write-Host "Running $($uninstall.FullName) ..." | |
& $uninstall.FullName -v -v --color=always | |
if ($LastExitCode -ne 0) { throw "uninstall failed! Exited with $LastExitCode" } | |
#-------- | |
# Release | |
#-------- | |
# | |
# We need Release to run even if the tests are disabled with _no_test tag | |
# or through a test-filter. That means we cannot put a dependency on | |
# the tests. | |
# With no dependency on tests, we can create a Release even if tests fail. | |
# But that is OK because the Release is just a Pre-release. | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Needed for softprops/action-gh-release@v1 | |
# Wait until `build` and `release-notes` complete | |
needs: | |
- build | |
- release-notes | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
path: dist | |
- name: Remove setup artifacts | |
run: rm -rf setup-* | |
working-directory: dist | |
- name: Restructure multi-ABI directories | |
run: | | |
_release="$(pwd)/_release" | |
install -d "$_release" | |
# Special case: Release notes are not part of multi-ABI | |
mv dist/release-notes release-notes | |
cd dist | |
find . -mindepth 1 -maxdepth 1 -type d | while read -r distname; do | |
rsync -av $distname/ "$_release" | |
done | |
- name: Display files to be distributed | |
run: ls -R | |
working-directory: _release | |
- name: Pre-release (only when Git tag pushed) | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-prerel') | |
with: | |
prerelease: true | |
# [draft] should make it not visible on the GitHub releases page | |
draft: true | |
body_path: release-notes/notes-prerelease.md | |
files: | | |
_release/* | |
- name: Full release (only when Git tag pushed) | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-prerel') | |
with: | |
# [draft] should make it not visible on the GitHub releases page. | |
# definitely should not be visible until signed. | |
draft: true | |
body_path: release-notes/notes-release.md | |
files: | | |
_release/* |