@@ -9,6 +9,22 @@ on:
9 types: [prereleased]
9 types: [prereleased]
13+ name: Check Haskell formatting
14+ runs-on: ubuntu-latest
16+ - uses: actions/checkout@v2
19+ uses: ./.github/actions/common_setup
21+ authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
25+ nix-shell nix/ci.nix -j auto --run "git ls-files '*.hs' | xargs fourmolu -m inplace -o -XRecursiveDo -o -XTypeApplications -o -XPatternSynonyms -o -XBangPatterns"
12 policeman:
28 policeman:
13 runs-on: ubuntu-latest
29 runs-on: ubuntu-latest
@@ -56,6 +72,14 @@ jobs:
75+ - name: Check changelog
76+ if: github.event_name == 'release'
78+ if ! grep '^## ${{ github.event.release.tag_name }}$' CHANGELOG.md; then
79+ echo "::error file=CHANGELOG.md::CHANGELOG.md does not contain an entry for this release."
60 needs: check_versions
84 needs: check_versions
61 runs-on: ubuntu-latest
85 runs-on: ubuntu-latest
@@ -160,6 +184,58 @@ jobs:
160 file: compaREST-Linux-x86.zip
184 file: compaREST-Linux-x86.zip
161 tag: ${{ github.ref }}
185 tag: ${{ github.ref }}
188+ needs: check_versions
189+ runs-on: ubuntu-latest
191+ - uses: actions/checkout@v2
193+ submodules: recursive
196+ uses: actions/cache@v1
201+ key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**.cabal') }}
203+ ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}
204+ ${{ runner.os }}-stack
206+ - name: Upgrade stack
208+ # Needed for Hackage token authorization
209+ run: stack upgrade --git
213+ stack sdist --pvp-bounds both --test-tarball
214+ echo "distPath=$(stack path | awk -F ": " '/dist-dir/ {print $2}')" >> $GITHUB_ENV
216+ - name: Upload compaREST sources artifact
217+ uses: actions/upload-artifact@v2
219+ name: compaREST sources
220+ path: ${{ env.distPath }}/*.tar.gz
222+ - name: Upload compaREST sources to release
223+ if: github.event_name == 'release'
224+ uses: svenstaro/upload-release-action@2.2.1
226+ repo_token: ${{ secrets.GITHUB_TOKEN }}
228+ file: ${{ env.distPath }}/*.tar.gz
229+ tag: ${{ github.ref }}
231+ - name: Publish compaREST candidate to Hackage
233+ if: github.event_name == 'release'
235+ HACKAGE_KEY: ${{ secrets.HACKAGE_KEY }}
237+ stack upload --pvp-bounds both --test-tarball --candidate .
164 needs: check_versions
240 needs: check_versions
165 runs-on: macos-latest
241 runs-on: macos-latest