77 push :
88 branches :
99 - main
10+ tags :
11+ - ' *'
1012 pull_request :
1113 workflow_dispatch :
1214
15+ permissions : read-all
16+
1317jobs :
1418 build-linux :
1519 strategy :
@@ -36,81 +40,114 @@ jobs:
3640 - name : Opam dependencies
3741 run : opam install --deps-only -t .
3842
39- - name : Format
40- run : opam exec -- dune fmt
43+ # - name: Format
44+ # run: opam exec -- dune fmt
4145
4246 - name : Build
4347 run : |
4448 opam exec -- dune subst
45- opam exec -- dune build -p ocamlformat-lib,ocamlformat
49+ opam exec -- dune build -p ocamlformat-mlx- lib,ocamlformat-mlx
4650
4751 - name : Runtest
4852 run : opam exec -- dune runtest
4953
50- - name : Check manpages
51- run : opam exec -- dune build @gen_manpage --auto-promote
54+ # - name: Check manpages
55+ # run: opam exec -- dune build @gen_manpage --auto-promote
5256
5357 - name : Upload binary
5458 # Using a specific version because of https://github.com/actions/upload-artifact/issues/590
5559 uses : actions/upload-artifact@v4.3.4
5660 with :
5761 name : ocamlformat-${{ runner.os }}-${{ runner.arch }}
58- path : _build/install/default/bin/ocamlformat
62+ path : _build/install/default/bin/ocamlformat-mlx
5963
60- test-branch :
61- if : ${{ github.ref != 'refs/heads/main' }}
64+ release :
6265 needs : build-linux
66+ permissions :
67+ contents : write # Required for pushing tags and creating releases
68+ pull-requests : write # Required for pushing opam PR
69+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
6370 runs-on : ubuntu-latest
64- strategy :
65- matrix :
66- profile :
67- - conventional
68- - ocamlformat
69- - janestreet
70- # To enable comparing with ocp-indent:
71- # include:
72- # - ocp_indent: true
73- # ocp_indent_config: JaneStreet
74- # profile: janestreet
7571
7672 steps :
77- - name : Install ocp-indent
78- if : ${{ matrix.ocp_indent }}
79- run : |
80- sudo apt install -y ocp-indent
81- sudo touch /etc/ocamlfind.conf
82-
83- # Clone the project
84- - uses : actions/checkout@v3
73+ - name : checkout tree
74+ uses : actions/checkout@v4
8575 with :
86- fetch-depth : 0
76+ submodules : ' true '
8777
88- - uses : actions/cache@v3
78+ - name : set-up OCaml
79+ uses : ocaml/setup-ocaml@v3
8980 with :
90- path : test-extra/code
91- key : test-extra-code
81+ ocaml-compiler : " 5.4"
9282
93- - name : Fetch main build of ocamlformat
94- uses : dawidd6/action-download-artifact@v6
95- with :
96- workflow : build-linux.yml
97- workflow_conclusion : " "
98- check_artifacts : true
99- branch : main
100- name : ocamlformat-${{ runner.os }}-${{ runner.arch }}
101- path : ocamlformat-a
83+ - name : Opam dependencies
84+ run : opam install --deps-only -t .
10285
103- - name : Fetch new build of ocamlformat
104- uses : actions/download-artifact@v4.1.7
105- with :
106- name : ocamlformat-${{ runner.os }}-${{ runner.arch }}
107- path : ocamlformat-b
86+ - run : opam install dune-release -y
10887
109- - name : Test ${{ matrix.profile }} profile
110- run : |
111- chmod +x ocamlformat-a/ocamlformat ocamlformat-b/ocamlformat
112- ./tools/test_branch.sh $TEST_BRANCH_ARGS -n -a ocamlformat-a/ocamlformat -b ocamlformat-b/ocamlformat 'profile=${{ matrix.profile }}'
113- shell : bash
114- env :
115- OCP_INDENT_CONFIG : ${{ matrix.ocp_indent_config }}
116- TEST_BRANCH_ARGS : ${{ matrix.ocp_indent && '-o -s' || '' }}
88+ - name : Run dune-release
89+ uses : davesnx/dune-release-action@v0.2.13
90+ with :
91+ packages : " ocamlformat-mlx,ocamlformat-mlx-lib"
92+ github-token : ${{ secrets.GH_TOKEN }}
93+ to-opam-repository : true
94+ to-github-releases : true
95+
96+ # test-branch:
97+ # if: ${{ github.ref != 'refs/heads/main' }}
98+ # needs: build-linux
99+ # runs-on: ubuntu-latest
100+ # strategy:
101+ # matrix:
102+ # profile:
103+ # - conventional
104+ # - ocamlformat
105+ # - janestreet
106+ # # To enable comparing with ocp-indent:
107+ # # include:
108+ # # - ocp_indent: true
109+ # # ocp_indent_config: JaneStreet
110+ # # profile: janestreet
111+ #
112+ # steps:
113+ # - name: Install ocp-indent
114+ # if: ${{ matrix.ocp_indent }}
115+ # run: |
116+ # sudo apt install -y ocp-indent
117+ # sudo touch /etc/ocamlfind.conf
118+ #
119+ # # Clone the project
120+ # - uses: actions/checkout@v3
121+ # with:
122+ # fetch-depth: 0
123+ #
124+ # - uses: actions/cache@v3
125+ # with:
126+ # path: test-extra/code
127+ # key: test-extra-code
128+ #
129+ # - name: Fetch main build of ocamlformat
130+ # uses: dawidd6/action-download-artifact@v6
131+ # with:
132+ # workflow: build-linux.yml
133+ # workflow_conclusion: ""
134+ # check_artifacts: true
135+ # branch: main
136+ # name: ocamlformat-${{ runner.os }}-${{ runner.arch }}
137+ # path: ocamlformat-a
138+ # allow_forks: true
139+ #
140+ # - name: Fetch new build of ocamlformat
141+ # uses: actions/download-artifact@v4.1.7
142+ # with:
143+ # name: ocamlformat-${{ runner.os }}-${{ runner.arch }}
144+ # path: ocamlformat-b
145+ #
146+ # - name: Test ${{ matrix.profile }} profile
147+ # run: |
148+ # chmod +x ocamlformat-a/ocamlformat ocamlformat-b/ocamlformat
149+ # ./tools/test_branch.sh $TEST_BRANCH_ARGS -n -a ocamlformat-a/ocamlformat -b ocamlformat-b/ocamlformat 'profile=${{ matrix.profile }}'
150+ # shell: bash
151+ # env:
152+ # OCP_INDENT_CONFIG: ${{ matrix.ocp_indent_config }}
153+ # TEST_BRANCH_ARGS: ${{ matrix.ocp_indent && '-o -s' || '' }}
0 commit comments