From c4ef398340c91bc45b6a985511c7edcda88a5607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20D=C3=A9n=C3=A8s?= Date: Tue, 8 Aug 2023 14:14:30 +0200 Subject: [PATCH 1/2] Automated submission of OPAM package on release --- .github/workflows/cd.yml | 29 ++++++++ .github/workflows/ci.yml | 78 ++-------------------- language-server/build-windows-platform.bat | 8 +-- language-server/vscoq-language-server.opam | 12 ++-- 4 files changed, 44 insertions(+), 83 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8acefd62c..a86defc68 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -21,3 +21,32 @@ jobs: yarn deploy env: VSCE_PAT: ${{ secrets.VSCE_PAT }} + + publish-opam-package: + strategy: + matrix: + os: [ubuntu-latest] + ocaml-compiler: [4.14.x] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use OCaml ${{ matrix.ocaml-compiler }} + uses: avsm/setup-ocaml@v2 + with: + ocaml-compiler: ${{ matrix.ocaml-compiler }} + + - name: Install opam-publish # 2.0.3 because more recent versions do not respect OPAMYES + run: opam install -y -j 2 opam-publish=2.0.3 + + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 + + - name: Publish + run: | + eval $(opam env) + VERSION_SLUG="${GITHUB_REF_SLUG#v}" + VERSION="${GITHUB_REF#v}" + cd language-server + opam publish --no-browser --repo=coq/opam-coq-archive --packages-directory=extra-dev/packages -v $VERSION https://github.com/coq-community/vscoq/releases/download/$GITHUB_REF/vscoq-language-server-$VERSION_SLUG.tar.gz vscoq-language-server.opam diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e54ef5f89..138abb55e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,9 +6,6 @@ on: pull_request: workflow_dispatch: -env: - PIN_COQ: 51814505fdeb5bc9f11fc7bd95493f0e7397509f - jobs: build-extension: strategy: @@ -68,17 +65,11 @@ jobs: with: ocaml-compiler: ${{ matrix.ocaml-compiler }} - - name: Pin Coq - env: - OPAMYES: true - run: | - opam pin add coq-core.dev "https://github.com/coq/coq.git#$PIN_COQ" - opam pin add coq-stdlib.dev "https://github.com/coq/coq.git#$PIN_COQ" - - name: Install vscoq-language-server env: OPAMYES: true run: | + opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev opam pin add vscoq-language-server ./language-server/ --with-doc --with-test -y - run: | @@ -111,6 +102,8 @@ jobs: - name: Build language server run: .\language-server\build-windows-platform.bat + env: + COQ_VERSION: V8.18+rc1 - run: C:\ci\cygwin64\bin\bash.exe --login -c 'echo vscoqtop=$(cygpath -m $(which vscoqtop))' >> $Env:GITHUB_ENV @@ -138,17 +131,11 @@ jobs: with: ocaml-compiler: ${{ matrix.ocaml-compiler }} - - name: Pin Coq - env: - OPAMYES: true - run: | - opam pin add coq-core.dev "https://github.com/coq/coq.git#$PIN_COQ" - opam pin add coq-stdlib.dev "https://github.com/coq/coq.git#$PIN_COQ" - - name: Install deps env: OPAMYES: true run: | + opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev opam install ./language-server/vscoq-language-server.opam --deps-only --with-doc --with-test - name: Build vscoq-language-server @@ -171,61 +158,6 @@ jobs: run: cat /tmp/vscoq_init_log.* - release-opam: - strategy: - matrix: - os: [ubuntu-latest] - ocaml-compiler: [4.14.x] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Use OCaml ${{ matrix.ocaml-compiler }} - uses: avsm/setup-ocaml@v2 - with: - ocaml-compiler: ${{ matrix.ocaml-compiler }} - - - name: Build release - run: | - eval $(opam env) - cd language-server - ./make-release.sh - - - name: Add released repo - run: | - eval $(opam env) - opam repo add release file://$PWD/language-server/_build/opam-repository - - - name: Pin Coq - env: - OPAMYES: true - run: | - opam pin add coq-core.dev "https://github.com/coq/coq.git#$PIN_COQ" - opam pin add coq-stdlib.dev "https://github.com/coq/coq.git#$PIN_COQ" - - - name: Install - run: | - eval $(opam env) - opam install vscoq-language-server - - - run: | - eval $(opam env) - echo "vscoqtop=`which vscoqtop`" >> $GITHUB_ENV - vscoqtop -v - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - run: cd client && yarn run package - - run: eval $(opam env) && cd client && xvfb-run yarn test - env: - VSCOQPATH: ${{ env.vscoqtop }} - VSCOQARGS: "-bt" - - if: ${{ failure() }} - run: cat /tmp/vscoq_init_log.* - create-release: runs-on: ubuntu-latest needs: [build-extension, nix-dev-build, install-opam, install-windows, dev-setup-opam] @@ -250,4 +182,4 @@ jobs: fail_on_unmatched_files: true draft: true prerelease: true - generate_release_notes: true \ No newline at end of file + generate_release_notes: true diff --git a/language-server/build-windows-platform.bat b/language-server/build-windows-platform.bat index d88708577..01d531fa7 100644 --- a/language-server/build-windows-platform.bat +++ b/language-server/build-windows-platform.bat @@ -31,13 +31,13 @@ call coq_platform_make_windows.bat ^ -jobs=2 ^ -switch=d ^ -set-switch=y ^ - -override-dev-pkg="coq-core=https://github.com/coq/coq/archive/%PIN_COQ%.tar.gz" ^ - -override-dev-pkg="coq-stdlib=https://github.com/coq/coq/archive/%PIN_COQ%.tar.gz" ^ - -override-dev-pkg="coq=https://github.com/coq/coq/archive/%PIN_COQ%.tar.gz" ^ + -override-dev-pkg="coq-core=https://github.com/coq/coq/archive/%COQ_VERSION%.tar.gz" ^ + -override-dev-pkg="coq-stdlib=https://github.com/coq/coq/archive/%COQ_VERSION%.tar.gz" ^ + -override-dev-pkg="coq=https://github.com/coq/coq/archive/%COQ_VERSION%.tar.gz" ^ || GOTO ErrorExit SET OPAMYES=yes -C:\ci\cygwin64\bin\bash.exe --login -c "opam pin add vscoq-language-server $(cygpath -m '%GITHUB_WORKSPACE%\language-server') --with-doc --with-test -y" || GOTO ErrorExit +C:\ci\cygwin64\bin\bash.exe --login -c "opam pin add --ignore-constraints-on=coq-core,coq-stdlib vscoq-language-server $(cygpath -m '%GITHUB_WORKSPACE%\language-server') --with-doc --with-test -y" || GOTO ErrorExit GOTO :EOF diff --git a/language-server/vscoq-language-server.opam b/language-server/vscoq-language-server.opam index 3233023b5..fe8982a22 100644 --- a/language-server/vscoq-language-server.opam +++ b/language-server/vscoq-language-server.opam @@ -1,19 +1,19 @@ opam-version: "2.0" name: "vscoq-language-server" maintainer: "Enrico Tassi " -authors: [ "Enrico Tassi" "Maxime Denes" ] -license: "LGPL-2.1-or-later" +authors: [ "Enrico Tassi" "Maxime Dénès" "Romain Tetley" ] +license: "MIT" homepage: "https://github.com/coq-community/vscoq" bug-reports: "https://github.com/coq-community/vscoq/issues" dev-repo: "git+https://github.com/coq-community/vscoq" build: [ - [ "sed" "-e" "/vendored_dirs coq/d" "-ibak" "dune" ] - [ "dune" "build" "-p" "vscoq-language-server" "--display=short"] + [ "dune" "build" "-p" name "-j" jobs ] ] depends: [ - "coq-core" {= "dev"} - "coq-stdlib" {= "dev"} + "ocaml" { >= "4.14.0" } + "coq-core" { >= "8.18" < "8.19" } + "coq-stdlib" { >= "8.18" < "8.19" } "yojson" "ocamlfind" "ppx_inline_test" From c0a7d0604c4eebb5d2a5d4bea74070c9d78dcc1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20D=C3=A9n=C3=A8s?= Date: Thu, 17 Aug 2023 15:31:42 +0200 Subject: [PATCH 2/2] Lower minimum required OCaml version For compatibility with the Coq Platform. --- .github/workflows/ci.yml | 4 ++-- language-server/vscoq-language-server.opam | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 138abb55e..c19732357 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - ocaml-compiler: [4.14.x] + ocaml-compiler: [4.13.x] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -120,7 +120,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - ocaml-compiler: [4.14.x] + ocaml-compiler: [4.13.x] runs-on: ${{ matrix.os }} steps: - name: Checkout diff --git a/language-server/vscoq-language-server.opam b/language-server/vscoq-language-server.opam index fe8982a22..24773c657 100644 --- a/language-server/vscoq-language-server.opam +++ b/language-server/vscoq-language-server.opam @@ -11,7 +11,7 @@ build: [ [ "dune" "build" "-p" name "-j" jobs ] ] depends: [ - "ocaml" { >= "4.14.0" } + "ocaml" { >= "4.13.1" } "coq-core" { >= "8.18" < "8.19" } "coq-stdlib" { >= "8.18" < "8.19" } "yojson"