diff --git a/.github/workflows/hackage.yml b/.github/workflows/hackage.yml new file mode 100644 index 0000000000..ec0d308098 --- /dev/null +++ b/.github/workflows/hackage.yml @@ -0,0 +1,133 @@ +name: Hackage + +on: + push: + branches: + - '*-hackage' + +jobs: + check-and-upload-tarballs: + runs-on: ubuntu-latest + strategy: + matrix: + package: ["hie-compat", "hls-graph", "shake-bench", + "hls-plugin-api", "ghcide", "hls-test-utils", + "hls-brittany-plugin", "hls-floskell-plugin", "hls-fourmolu-plugin", + "hls-ormolu-plugin", "hls-stylish-haskell-plugin", + "hls-class-plugin", "hls-eval-plugin", "hls-explicit-imports-plugin", + "hls-haddock-comments-plugin", "hls-hlint-plugin", + "hls-module-name-plugin", "hls-pragmas-plugin", + "hls-refine-imports-plugin", "hls-retrie-plugin", + "hls-splice-plugin", "hls-tactics-plugin", + "hls-call-hierarchy-plugin", + "haskell-language-server"] + ghc: ["8.10.7", "8.8.4", "8.6.5"] + + steps: + + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: haskell/actions/setup@v1 + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: '3.4' + + - name: Cache Cabal + uses: actions/cache@v2 + env: + cache-name: cache-cabal + with: + path: | + ~/.cabal/packages + ~/.cabal/store + key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }} + restore-keys: | + v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }} + v2-${{ runner.os }}-${{ matrix.ghc }}-build- + v2-${{ runner.os }}-${{ matrix.ghc }} + + - name: "Run cabal check" + run: | + if [[ ${{ matrix.package }} == *plugin ]]; then + cd plugins + fi + if [[ ${{ matrix.package }} != haskell-language-server ]]; then + cd ${{ matrix.package }} + fi + cabal check + + - name: "Generate package dist tarball" + id: generate-dist-tarball + run: | + if [[ ${{ matrix.package }} == haskell-language-server ]]; then + cabal sdist --builddir=./ + else + cabal sdist ${{ matrix.package }} --builddir=./ + fi + echo ::set-output name=path::$(ls ./sdist/${{ matrix.package }}-*) + + - name: "Unpack package source in an isolated location" + run: cabal unpack ${{ steps.generate-dist-tarball.outputs.path }} --destdir=./incoming + + - name: "Try to get the current hackage version" + id: get-hackage-version + run: | + cd ./incoming + if cabal get $(ls -d ${{ matrix.package }}-*) --destdir=../current; then + echo ::set-output name=exists::true + fi + + - name: "Compare the incoming and the current hackage version of the package" + id: compare-current-version + if: steps.get-hackage-version.exists == 'true' + run: | + # This will throw an error if there is any difference cause we have to bump up the package version + diff -qr -x "*.md" -x "data" $(ls -d ./incoming/${{ matrix.package }}-*) $(ls -d ./current/${{ matrix.package }}-*) + + - name: "Create appropiate cabal.project" + if: steps.get-hackage-version.exists != 'true' + run: | + cd $(ls -d ./incoming/${{ matrix.package }}-*) + echo "packages: . ../../* ../../plugins/*" > cabal.project + # TODO: remove when not needed + echo "allow-newer: Chart-diagrams:diagrams-core, SVGFonts:diagrams-core" >> cabal.project + + - name: "Build all package components in isolation" + if: steps.get-hackage-version.exists != 'true' + run: | + cd $(ls -d ./incoming/${{ matrix.package }}-*) + cabal build --enable-tests --enable-benchmarks + + - name: "Generate haddock for hackage" + if: steps.get-hackage-version.exists != 'true' + run: | + cd $(ls -d ./incoming/${{ matrix.package }}-*) + cabal haddock --haddock-for-hackage + + - name: "Upload package dist tarball" + if: steps.get-hackage-version.exists != 'true' + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.package }} + path: ${{ steps.generate-dist-tarball.outputs.path }} + + upload-candidate: + needs: check-and-upload-tarballs + runs-on: ubuntu-latest + steps: + + - uses: actions/download-artifact@v2 + with: + path: packages + + - name: "Join all tarballs" + run: find ./packages -type f -name '*.tar.gz' -exec cp {} ./packages \; + + - name: "Upload all tarballs to hackage" + uses: haskell-actions/hackage-publish@v1 + with: + hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }} + packagesPath: packages + publish: false diff --git a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal b/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal index 140f547c95..5d6ac8b9b8 100644 --- a/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal +++ b/plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal @@ -2,6 +2,9 @@ cabal-version: 2.4 name: hls-call-hierarchy-plugin version: 1.0.0.2 synopsis: Call hierarchy plugin for Haskell Language Server +description: + Please see the README on GitHub at + license: Apache-2.0 license-file: LICENSE author: Lei Zhu @@ -21,7 +24,7 @@ library hs-source-dirs: src build-depends: - , aeson + , aeson >=1.5.2.0 , base >=4.12 && <5 , bytestring , containers diff --git a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal b/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal index 98961ad2f5..cde982cf6f 100644 --- a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal +++ b/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal @@ -2,6 +2,8 @@ cabal-version: 2.2 name: hls-explicit-imports-plugin version: 1.0.0.4 synopsis: Explicit imports plugin for Haskell Language Server +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: Pepe Iborra diff --git a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal index 3a0c54485c..9a839d33ae 100644 --- a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal +++ b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal @@ -3,7 +3,7 @@ name: hls-hlint-plugin version: 1.0.1.1 synopsis: Hlint integration plugin with Haskell Language Server description: - Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme) + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE diff --git a/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal b/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal index 7b16113a4a..4a2b3a71b9 100644 --- a/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal +++ b/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal @@ -1,7 +1,9 @@ -cabal-version: 2.2 +cabal-version: 2.4 name: hls-refine-imports-plugin version: 1.0.0.1 synopsis: Refine imports plugin for Haskell Language Server +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: rayshih diff --git a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal b/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal index 74ddd52caf..7b9f1c190e 100644 --- a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal +++ b/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal @@ -2,6 +2,8 @@ cabal-version: 2.2 name: hls-retrie-plugin version: 1.0.1.1 synopsis: Retrie integration plugin for Haskell Language Server +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: Pepe Iborra diff --git a/plugins/hls-splice-plugin/hls-splice-plugin.cabal b/plugins/hls-splice-plugin/hls-splice-plugin.cabal index 64786bfd33..4f9d7600e5 100644 --- a/plugins/hls-splice-plugin/hls-splice-plugin.cabal +++ b/plugins/hls-splice-plugin/hls-splice-plugin.cabal @@ -5,7 +5,7 @@ synopsis: HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes description: - HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes. + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE diff --git a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal b/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal index 25570a2156..42ced2748b 100644 --- a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal +++ b/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal @@ -2,6 +2,8 @@ cabal-version: 2.4 name: hls-stylish-haskell-plugin version: 1.0.0.2 synopsis: Integration with the Stylish Haskell code formatter +description: + Please see the README on GitHub at license: Apache-2.0 license-file: LICENSE author: The Haskell IDE Team diff --git a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal index 161f7e2613..ef9e605202 100644 --- a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal +++ b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal @@ -3,7 +3,8 @@ category: Development name: hls-tactics-plugin version: 1.3.0.0 synopsis: Wingman plugin for Haskell Language Server -description: Please see README.md +description: + Please see the README on GitHub at author: Sandy Maguire, Reed Mullanix maintainer: sandy@sandymaguire.me copyright: Sandy Maguire, Reed Mullanix