Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #101
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
release: | |
types: [published] | |
env: | |
BUNDLE_DIR: bundle | |
jobs: | |
build_server: | |
name: Build server | |
# Note that this must be kept in sync with the version of Ubuntu which the | |
# Pursit server is running, otherwise the server binary may fail to run. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: haskell/actions/setup@v1 | |
with: | |
enable-stack: true | |
stack-version: "2.5.1" | |
stack-no-global: true | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml.lock') }}-${{ hashFiles('pursuit.cabal') }} | |
- name: Build server code | |
run: | | |
stack --no-terminal --jobs=2 build --flag pursuit:-dev | |
- name: Test server code | |
run: | | |
stack --no-terminal --jobs=2 test --flag pursuit:-dev --pedantic | |
- name: Build server assets | |
if: github.event_name == 'release' | |
run: | | |
mkdir ${{ env.BUNDLE_DIR }} | |
cp $(stack path --dist-dir)/build/pursuit/pursuit ${{ env.BUNDLE_DIR }}/ | |
cp LICENSE ${{ env.BUNDLE_DIR }}/ | |
cp -r deploy/ ${{ env.BUNDLE_DIR }}/ | |
tar czf pursuit.tar.gz -C ${{ env.BUNDLE_DIR }}/ . | |
- name: Persist server assets | |
uses: actions/upload-artifact@v2 | |
if: github.event_name == 'release' | |
with: | |
name: pursuit.tar.gz | |
path: pursuit.tar.gz | |
retention-days: 1 | |
release: | |
name: Release | |
# Note that this must be kept in sync with the version of Ubuntu which the | |
# Pursit server is running, otherwise the server binary may fail to run. | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
needs: | |
- build_server | |
steps: | |
- name: Retrieve server assets | |
uses: actions/[email protected] | |
with: | |
name: pursuit.tar.gz | |
- name: Upload assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
pursuit.tar.gz |