Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions .github/workflows/build-mingw64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,66 @@ on:
required: true
default: 'main'

env:
CYGWINSETUP: setup-x86_64.exe
PACKAGES: git,m4,patchutils,make,curl,unzip,mingw64-x86_64-binutils,mingw64-x86_64-gcc-core,mingw64-x86_64-headers,mingw64-x86_64-runtime
SITE: https://mirrors.kernel.org/sourceware/cygwin

jobs:
build:
runs-on: windows-latest
env:
SHELLOPTS: igncr
steps:
- name: Set Build Ref for Release Builds
- name: Set ref for release builds
if: github.event_name == 'release'
run: |
"build_ref=${{ github.ref }}" >> $env:GITHUB_ENV
- name: Set Build Ref for Manual Builds

- name: Set ref for manual builds
if: github.event_name == 'workflow_dispatch'
run: |
"build_ref=${{ github.event.inputs.ref }}" >> $env:GITHUB_ENV

- name: Set artifact name
shell: bash
run: |
echo "artifact_name=ocamlformat-${build_ref##*/}.exe" >> $GITHUB_ENV

- name: Disable Git EOL Conversion
run: |
git config --global core.autocrlf false

- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ env.build_ref }}
- name: Download Cygwin Installer
run: |
curl.exe -o C:\${{ env.CYGWINSETUP }} https://www.cygwin.com/${{ env.CYGWINSETUP }}
shell: cmd
- name: Setup Cygwin

- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
opam-repositories: |
default: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
opam: https://github.com/ocaml/opam-repository.git

- name: Install dependencies
run: |
C:\${{ env.CYGWINSETUP }} -A -q -D -L -g -o -s ${{ env.SITE }} -l C:\cygwin64-cache -R C:\cygwin64 -C Base -P ${{ env.PACKAGES }}
shell: cmd
- name: Run Build Script
opam pin add -yn ocamlformat-lib.dev .
opam pin add -yn ocamlformat.dev .
opam install -y --deps-only ocamlformat

- name: Build
run: |
cd '${{ github.workspace }}'
git config --global --add safe.directory "$(pwd)"
bash tools/build-mingw64.sh
echo "artifact_name=ocamlformat-$(basename ${{ env.build_ref }}).exe" >> $GITHUB_ENV
shell: C:\cygwin64\bin\bash.exe --login --norc '{0}'
- name: Rename Artifact
opam exec -- dune subst
opam exec -- dune build -p ocamlformat-lib,ocamlformat @install
opam exec -- dune install --prefix=install ocamlformat
Copy-Item ${{ github.workspace }}\\install\\bin\\ocamlformat.exe -Destination .\${{ env.artifact_name }}

- name: Version check
run: |
Copy-Item ${{ github.workspace }}\_build\install\default\bin\ocamlformat.exe -Destination .\${{ env.artifact_name }}
echo "Version check:"
install/bin/ocamlformat.exe --version

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.artifact_name }}
path: ${{ env.artifact_name }}
if-no-files-found: error

- name: Upload Release Asset
if: github.event_name == 'release'
run: >
Expand Down
20 changes: 10 additions & 10 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ profile. This started with version 0.26.0.
- Protect match after `fun _ : _ ->` (#2352, @Julow)
- Fix invalid formatting of `(::)` (#2347, @Julow)
- Fix indentation of module-expr extensions (#2323, @gpetiot)
* Remove double parentheses around tuples in a match (#2308, @Julow)
* Remove extra parentheses around module packs (#2305, @Julow, @gpetiot)
- \* Remove double parentheses around tuples in a match (#2308, @Julow)
- \* Remove extra parentheses around module packs (#2305, @Julow, @gpetiot)
- Fix indentation of trailing double-semicolons (#2295, @gpetiot)
- Fix formatting of comments in "disable" chunks (#2279, @gpetiot)
- Fix non-stabilizing comments attached to private/virtual/mutable keywords (#2272, #2307, @gpetiot, @Julow)
Expand All @@ -30,17 +30,17 @@ profile. This started with version 0.26.0.

- Improve formatting of doc-comments (#2338, #2349, #2376, #2377, #2379, #2378, @Julow)
Remove unnecessary escaping and preserve empty lines.
* Indent `as`-patterns that have parentheses (#2359, @Julow)
- \* Indent `as`-patterns that have parentheses (#2359, @Julow)
- Don't print warnings related to odoc code-blocks when '--quiet' is set (#2336, #2373, @gpetiot, @Julow)
* Improve formatting of module arguments (#2322, @Julow)
* Don't indent attributes after a let/val/external (#2317, @Julow)
- \* Improve formatting of module arguments (#2322, @Julow)
- \* Don't indent attributes after a let/val/external (#2317, @Julow)
- Consistent indentation of `@@ let+ x = ...` (#2315, #2396, @Julow)
It was formatted differently than `@@ let x = ...`.
* Improve formatting of class expressions and signatures (#2301, #2328, #2387, @gpetiot, @Julow)
* Consistent indentation of `fun (type a) ->` following `fun x ->` (#2294, @Julow)
* Restore short-form formatting of record field aliases (#2282, #2388, @gpetiot, @Julow)
* Restore short-form for first-class modules: `((module M) : (module S))` is formatted as `(module M : S)`) (#2280, #2300, @gpetiot, @Julow)
* Improve indentation of `~label:(fun ...` (#2271, #2291, #2293, #2298, #2398, @Julow)
- \* Improve formatting of class expressions and signatures (#2301, #2328, #2387, @gpetiot, @Julow)
- \* Consistent indentation of `fun (type a) ->` following `fun x ->` (#2294, @Julow)
- \* Restore short-form formatting of record field aliases (#2282, #2388, @gpetiot, @Julow)
- \* Restore short-form for first-class modules: `((module M) : (module S))` is formatted as `(module M : S)`) (#2280, #2300, @gpetiot, @Julow)
- \* Improve indentation of `~label:(fun ...` (#2271, #2291, #2293, #2298, #2398, @Julow)
The `fun` keyword is docked where possible and the arguments are indented to avoid confusion with the body.
- JaneStreet profile: treat comments as doc-comments (#2261, #2344, #2354, #2365, #2392, @gpetiot, @Julow)
- Tweaks the JaneStreet profile to be more consistent with ocp-indent (#2214, #2281, #2284, #2289, #2299, #2302, #2309, #2310, #2311, #2313, #2316, #2362, #2363, @gpetiot, @Julow)
Expand Down
4 changes: 1 addition & 3 deletions HACKING.org
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ Git is used to manage the script's state:
=git push --tags=

- Release in automatic mode
=dune-release -p ocamlformat,ocamlformat-rpc-lib=
Until dune-release.1.5.0 is released the =main= branch of dune-release
should be used.
=dune-release -p ocamlformat-lib,ocamlformat,ocamlformat-rpc-lib=

- Close release milestone.

Expand Down
3 changes: 2 additions & 1 deletion ocamlformat-lib.opam
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ build: [
]
]
dev-repo: "git+https://github.com/ocaml-ppx/ocamlformat.git"
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"] # OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
# OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"]
3 changes: 2 additions & 1 deletion ocamlformat-lib.opam.template
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"] # OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
# OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"]
3 changes: 2 additions & 1 deletion ocamlformat.opam
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ build: [
]
]
dev-repo: "git+https://github.com/ocaml-ppx/ocamlformat.git"
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"] # OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
# OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"]
3 changes: 2 additions & 1 deletion ocamlformat.opam.template
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"] # OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
# OCamlFormat is distributed under the MIT license. Parts of the OCaml library are vendored for OCamlFormat and distributed under their original LGPL 2.1 license
license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"]
57 changes: 0 additions & 57 deletions tools/build-mingw64.sh

This file was deleted.