-
-
Notifications
You must be signed in to change notification settings - Fork 396
Semiautomatic hackage releases #2163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e69b12
6b5940c
ce5fe59
2937f92
f6ea6bf
9073726
32f214c
227ef73
a5494b9
a0c995d
79d5165
10866bc
634de83
e39d910
98fd390
82b96bf
3ed1e5b
cd0df38
0ea5964
aaa6681
2afeec7
77f5329
b445cfa
8796afb
8bbc7a4
1fd80c4
47a95bc
122d095
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are only needed to build the benchmark suite of ghcide. The benchmark suite is not a requirement for uploading to Hackage imho, and should be skipped There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ya, but to use a simple autogenerated cabal.project with |
||||||
|
||||||
- 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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ideally benchmarks should be able to run using the hackage version |
||||||
|
||||||
- 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <https://github.com/haskell/haskell-language-server#readme> | ||
author: Sandy Maguire, Reed Mullanix | ||
maintainer: [email protected] | ||
copyright: Sandy Maguire, Reed Mullanix | ||
|
Uh oh!
There was an error while loading. Please reload this page.