@@ -184,17 +184,50 @@ jobs:
185 submodules: recursive
185 submodules: recursive
188+ uses: actions/cache@v1
193+ key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('**.cabal') }}
195+ ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}
196+ ${{ runner.os }}-stack
198+ - name: Upgrade stack
200+ # Needed for Hackage token authorization
201+ run: stack upgrade --git
187 - name: Build dist
203 - name: Build dist
189 stack sdist --pvp-bounds both --test-tarball
205 stack sdist --pvp-bounds both --test-tarball
190 echo "distPath=$(stack path | awk -F ": " '/dist-dir/ {print $2}')" >> $GITHUB_ENV
206 echo "distPath=$(stack path | awk -F ": " '/dist-dir/ {print $2}')" >> $GITHUB_ENV
192− - name: compaREST sources artifact
208+ - name: Upload compaREST sources artifact
193 uses: actions/upload-artifact@v2
209 uses: actions/upload-artifact@v2
195 name: compaREST sources
211 name: compaREST sources
196 path: ${{ env.distPath }}/*.tar.gz
212 path: ${{ env.distPath }}/*.tar.gz
214+ - name: Upload compaREST sources to release
215+ if: github.event_name == 'release'
216+ uses: svenstaro/upload-release-action@2.2.1
218+ repo_token: ${{ secrets.GITHUB_TOKEN }}
220+ file: ${{ env.distPath }}/*.tar.gz
221+ tag: ${{ github.ref }}
223+ - name: Publish compaREST candidate to Hackage
225+ if: github.event_name == 'release'
227+ HACKAGE_KEY: ${{ secrets.HACKAGE_KEY }}
229+ stack upload --pvp-bounds both --test-tarball --candidate .
199 needs: check_versions
232 needs: check_versions
200 runs-on: macos-latest
233 runs-on: macos-latest