From 231c6da98fb1ccfa65b73bdee822184e957a4744 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 17:41:17 -0700 Subject: [PATCH 01/20] Add GH Actions workflow --- .github/workflows/ci.yml | 81 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 41 -------------------- ci/before_deploy.sh | 24 ------------ ci/build.sh | 22 ----------- client/.travis.yml | 10 ----- 5 files changed, 81 insertions(+), 97 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100755 ci/before_deploy.sh delete mode 100755 ci/build.sh delete mode 100644 client/.travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..2e8bd219 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,81 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + build_server: + name: Build server + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 + with: + enable-stack: true + stack-setup-ghc: true + - run: | + timeout 35m stack --no-terminal -j1 build + + build_client: + name: Build client + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - run: | + cd client + npm install -g bower + npm install + bower install --production + npm run -s test + npm run build:production + + upload_server: + name: Upload server asset + runs-on: ubuntu-latest + needs: build_server + if: github.event_name == 'release' && github.event.action == 'created' + steps: + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 + with: + enable-stack: true + stack-setup-ghc: true + - run: | + mkdir bundle + cp $(stack path --dist-dir)/build/trypurescript/trypurescript bundle/ + cp LICENSE bundle/ + cp -r deploy/ bundle/ + cp -r staging/ bundle/ + tar czf trypurescript-server.tar.gz -C bundle/ . + + upload_client: + name: Upload client assets + runs-on: ubuntu-latest + needs: build_client + if: github.event_name == 'release' && github.event.action == 'created' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - run: | + mkdir bundle + cp LICENSE bundle/ + cp -r client/public/ bundle/ + tar czf trypurescript-client.tar.gz -C bundle/ . + + release: + name: Release + runs-on: ubuntu-latest + needs: + - upload_server + - upload_client + uses: softprops/action-gh-release@v1 + if: github.event_name == 'release' && github.event.action == 'created' + with: + files: | + trypurescript-server.tar.gz + trypurescript-client.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 244a97c0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -sudo: false - -# Choose a lightweight base image; we provide our own tools. -language: c - -cache: - directories: - - $HOME/.ghc - - $HOME/.cabal - - $HOME/.stack - -addons: - apt: - packages: - - libgmp-dev - -env: - - COMPONENT=client - - COMPONENT=server - -before_install: - - mkdir -p ~/.local/bin - - export PATH=$HOME/.local/bin:$PATH - - curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - -script: - ./ci/build.sh - -notifications: - email: true - -before_deploy: - ./ci/before_deploy.sh - -deploy: - provider: releases - edge: true # use dpl v2 - token: $GITHUB_TOKEN - file: trypurescript-$COMPONENT.tar.gz - on: - tags: true diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh deleted file mode 100755 index 52cfbf97..00000000 --- a/ci/before_deploy.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/env bash - -set -ex - -case $COMPONENT in - server) - mkdir bundle - cp $(stack path --dist-dir)/build/trypurescript/trypurescript bundle/ - cp LICENSE bundle/ - cp -r deploy/ bundle/ - cp -r staging/ bundle/ - tar czf trypurescript-server.tar.gz -C bundle/ . - ;; - client) - mkdir bundle - cp LICENSE bundle/ - cp -r client/public/ bundle/ - tar czf trypurescript-client.tar.gz -C bundle/ . - ;; - *) - echo >&2 "Unrecognised component: $COMPONENT" - exit 1 - ;; -esac diff --git a/ci/build.sh b/ci/build.sh deleted file mode 100755 index 86fc032a..00000000 --- a/ci/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env bash - -set -ex - -case $COMPONENT in - server) - # Set a timeout of 35 minutes. We could use travis_wait here, but travis_wait - # doesn't produce any output until the command finishes, and also doesn't - # always show all of the command's output. - timeout 35m stack --no-terminal -j1 --install-ghc build - ;; - client) - cd client - npm install - # Use production config, since we want to use these bundles for deploys - npm run build:production - ;; - *) - echo >&2 "Unrecognised component: $COMPONENT" - exit 1 - ;; -esac diff --git a/client/.travis.yml b/client/.travis.yml deleted file mode 100644 index 32d9b31a..00000000 --- a/client/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -dist: bionic -sudo: required -node_js: 12 -install: - - npm install -g bower - - npm install - - bower install --production -script: - - npm run -s test From 3fcef12a1588002190faf38c527ed439e7403402 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 17:41:59 -0700 Subject: [PATCH 02/20] Run on push --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e8bd219..bc9b3756 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,6 @@ name: CI -on: - push: - branches: [master] - pull_request: +on: [push] jobs: build_server: From 2a61b4f69654204dae14b97898dcaaaad326d28f Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 17:45:32 -0700 Subject: [PATCH 03/20] Run on push, pull request --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc9b3756..2e8bd219 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: CI -on: [push] +on: + push: + branches: [master] + pull_request: jobs: build_server: From abaa25dffe23949422f12fff134a884fcb221081 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 17:51:52 -0700 Subject: [PATCH 04/20] Fix release job --- .github/workflows/ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e8bd219..a841ae3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,8 @@ jobs: upload_server: name: Upload server asset runs-on: ubuntu-latest - needs: build_server if: github.event_name == 'release' && github.event.action == 'created' + needs: build_server steps: - uses: actions/checkout@v2 - uses: haskell/actions/setup@v1 @@ -54,8 +54,8 @@ jobs: upload_client: name: Upload client assets runs-on: ubuntu-latest - needs: build_client if: github.event_name == 'release' && github.event.action == 'created' + needs: build_client steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 @@ -68,14 +68,15 @@ jobs: release: name: Release runs-on: ubuntu-latest - needs: - - upload_server - - upload_client - uses: softprops/action-gh-release@v1 if: github.event_name == 'release' && github.event.action == 'created' - with: - files: | - trypurescript-server.tar.gz - trypurescript-client.tar.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + needs: + - upload_server + - upload_client + steps: + - uses: softprops/action-gh-release@v1 + with: + files: | + trypurescript-server.tar.gz + trypurescript-client.tar.gz From d86bde1f1532fee0ecac2257051bc2555208aae3 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 17:55:11 -0700 Subject: [PATCH 05/20] Fix client --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a841ae3e..ae88a56b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,10 +26,9 @@ jobs: - uses: actions/setup-node@v2 - run: | cd client - npm install -g bower npm install - bower install --production - npm run -s test + npm run build + npm run test npm run build:production upload_server: From c8684f103b1625e7502c864dfa3e86eeb05abcf1 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 18:04:41 -0700 Subject: [PATCH 06/20] Update bundle names --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae88a56b..a98a63d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,12 +43,12 @@ jobs: enable-stack: true stack-setup-ghc: true - run: | - mkdir bundle - cp $(stack path --dist-dir)/build/trypurescript/trypurescript bundle/ - cp LICENSE bundle/ - cp -r deploy/ bundle/ - cp -r staging/ bundle/ - tar czf trypurescript-server.tar.gz -C bundle/ . + mkdir server-bundle + cp $(stack path --dist-dir)/build/trypurescript/trypurescript server-bundle/ + cp LICENSE server-bundle/ + cp -r deploy/ server-bundle/ + cp -r staging/ server-bundle/ + tar czf trypurescript-server.tar.gz -C server-bundle/ . upload_client: name: Upload client assets @@ -59,10 +59,10 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 - run: | - mkdir bundle - cp LICENSE bundle/ - cp -r client/public/ bundle/ - tar czf trypurescript-client.tar.gz -C bundle/ . + mkdir client-bundle + cp LICENSE client-bundle/ + cp -r client/public/ client-bundle/ + tar czf trypurescript-client.tar.gz -C client-bundle/ . release: name: Release From 42206e812a69297a6d5838399037949ff071fc49 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 18:28:22 -0700 Subject: [PATCH 07/20] Add cache, temporarily enable release steps --- .github/workflows/ci.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a98a63d5..abe19fde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,17 @@ jobs: with: enable-stack: true stack-setup-ghc: true - - run: | + + - name: Cache stack + uses: actions/cache@v1 + with: + path: $HOME/.stack + key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }} + restore-keys: | + ${{ runner.os }}- + + - name: Build server code + run: | timeout 35m stack --no-terminal -j1 build build_client: @@ -24,7 +34,9 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 - - run: | + + - name: Build client code + run: | cd client npm install npm run build @@ -34,7 +46,7 @@ jobs: upload_server: name: Upload server asset runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'created' + # if: github.event_name == 'release' && github.event.action == 'created' needs: build_server steps: - uses: actions/checkout@v2 @@ -49,20 +61,21 @@ jobs: cp -r deploy/ server-bundle/ cp -r staging/ server-bundle/ tar czf trypurescript-server.tar.gz -C server-bundle/ . + ls upload_client: name: Upload client assets runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'created' + # if: github.event_name == 'release' && github.event.action == 'created' needs: build_client steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - run: | mkdir client-bundle cp LICENSE client-bundle/ cp -r client/public/ client-bundle/ tar czf trypurescript-client.tar.gz -C client-bundle/ . + ls release: name: Release From b0882f5e32bf1a416f9fb94f7258f3adb9be8855 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 19:06:28 -0700 Subject: [PATCH 08/20] Remove setup-ghc options and extend timeout --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abe19fde..a877671b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,6 @@ jobs: - uses: haskell/actions/setup@v1 with: enable-stack: true - stack-setup-ghc: true - name: Cache stack uses: actions/cache@v1 @@ -26,7 +25,7 @@ jobs: - name: Build server code run: | - timeout 35m stack --no-terminal -j1 build + timeout 45m stack --no-terminal -j1 build build_client: name: Build client @@ -44,7 +43,7 @@ jobs: npm run build:production upload_server: - name: Upload server asset + name: Build server assets runs-on: ubuntu-latest # if: github.event_name == 'release' && github.event.action == 'created' needs: build_server @@ -64,7 +63,7 @@ jobs: ls upload_client: - name: Upload client assets + name: Build client assets runs-on: ubuntu-latest # if: github.event_name == 'release' && github.event.action == 'created' needs: build_client From 7e28af4329a5be9e10e3ddefe225e7dae9c015e8 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 21:25:59 -0700 Subject: [PATCH 09/20] Use persisted artifacts --- .github/workflows/ci.yml | 84 ++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a877671b..24e0c44b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: pull_request: jobs: + env: + SERVER_ASSET: trypurescript-server + CLIENT_ASSET: trypurescript-client build_server: name: Build server runs-on: ubuntu-latest @@ -27,6 +30,22 @@ jobs: run: | timeout 45m stack --no-terminal -j1 build + - name: Build server assets + # if: github.event_name == 'release' && github.event.action == 'created' + run: | + mkdir ${{ env.SERVER_ASSET }} + cp $(stack path --dist-dir)/build/trypurescript/trypurescript ${{ env.SERVER_ASSET }}/ + cp LICENSE ${{ env.SERVER_ASSET }}/ + cp -r deploy/ ${{ env.SERVER_ASSET }}/ + cp -r staging/ ${{ env.SERVER_ASSET}}/ + tar czf ${{ env.SERVER_ASSET }}.tar.gz -C ${{ env.SERVER_ASSET }}/ . + + - name: Persist server assets + uses: actions/upload-artifact@v2 + # if: github.event_name == 'release' && github.event.action == 'created' + with: + path: ${{ env.SERVER_ASSET }}.tar.gz + build_client: name: Build client runs-on: ubuntu-latest @@ -42,39 +61,19 @@ jobs: npm run test npm run build:production - upload_server: - name: Build server assets - runs-on: ubuntu-latest - # if: github.event_name == 'release' && github.event.action == 'created' - needs: build_server - steps: - - uses: actions/checkout@v2 - - uses: haskell/actions/setup@v1 - with: - enable-stack: true - stack-setup-ghc: true - - run: | - mkdir server-bundle - cp $(stack path --dist-dir)/build/trypurescript/trypurescript server-bundle/ - cp LICENSE server-bundle/ - cp -r deploy/ server-bundle/ - cp -r staging/ server-bundle/ - tar czf trypurescript-server.tar.gz -C server-bundle/ . - ls + - name: Build client assets + # if: github.event_name == 'release' && github.event.action == 'created' + run: | + mkdir ${{ env.CLIENT_ASSET }} + cp LICENSE ${{ env.CLIENT_ASSET }}/ + cp -r client/public/ ${{ env.CLIENT_ASSET }}/ + tar czf ${{ env.CLIENT_ASSET }}.tar.gz -C ${{ env.CLIENT_ASSET }}/ . - upload_client: - name: Build client assets - runs-on: ubuntu-latest - # if: github.event_name == 'release' && github.event.action == 'created' - needs: build_client - steps: - - uses: actions/checkout@v2 - - run: | - mkdir client-bundle - cp LICENSE client-bundle/ - cp -r client/public/ client-bundle/ - tar czf trypurescript-client.tar.gz -C client-bundle/ . - ls + - name: Persist client assets + uses: actions/upload-artifact@v2 + # if: github.event_name == 'release' && github.event.action == 'created' + with: + path: ${{ env.CLIENT_ASSET }}.tar.gz release: name: Release @@ -83,11 +82,22 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} needs: - - upload_server - - upload_client + - build_server + - build_client steps: - - uses: softprops/action-gh-release@v1 + - name: Retrieve server assets + uses: actions/download-artifact@v2 + with: + name: ${{ env.SERVER_ASSET }}.tar.gz + + - name: Retrieve client assets + uses: actions/download-artifact@v2 + with: + name: ${{ env.CLIENT_ASSET }}.tar.gz + + - name: Upload server and client assets + uses: softprops/action-gh-release@v1 with: files: | - trypurescript-server.tar.gz - trypurescript-client.tar.gz + ${{ env.SERVER_ASSET }}.tar.gz + ${{ env.CLIENT_ASSET }}.tar.gz From 7c30eca056a4d81cb7279e76824f56f0726af2a4 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 21:27:05 -0700 Subject: [PATCH 10/20] Set short retention period --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24e0c44b..b9742291 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,7 @@ jobs: # if: github.event_name == 'release' && github.event.action == 'created' with: path: ${{ env.SERVER_ASSET }}.tar.gz + retention-days: 1 build_client: name: Build client @@ -74,6 +75,7 @@ jobs: # if: github.event_name == 'release' && github.event.action == 'created' with: path: ${{ env.CLIENT_ASSET }}.tar.gz + retention-days: 1 release: name: Release From 145f7612cf0aef37f0a7c04906b4180610f16fb8 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 21:28:14 -0700 Subject: [PATCH 11/20] Move env to top level --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9742291..94ab71f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,11 @@ on: branches: [master] pull_request: +env: + SERVER_ASSET: trypurescript-server + CLIENT_ASSET: trypurescript-client + jobs: - env: - SERVER_ASSET: trypurescript-server - CLIENT_ASSET: trypurescript-client build_server: name: Build server runs-on: ubuntu-latest From 2c7192ed428a9cbd408e33e7d6aa13556518535a Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 21:35:24 -0700 Subject: [PATCH 12/20] Adjust cache --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94ab71f1..a9af067d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,10 +22,10 @@ jobs: - name: Cache stack uses: actions/cache@v1 with: - path: $HOME/.stack - key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }} - restore-keys: | - ${{ runner.os }}- + path: | + ~/.stack + .stack-work + key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }} - name: Build server code run: | From 43eb83c601bcff0b855ad0dcc7de37d5bce8f7f7 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 22:13:19 -0700 Subject: [PATCH 13/20] Adjust cache again --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9af067d..6e852f0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,13 +19,15 @@ jobs: with: enable-stack: true - - name: Cache stack - uses: actions/cache@v1 + - name: Cache dependencies + uses: actions/cache@v2 with: path: | ~/.stack .stack-work - key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }} + key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml.lock') }} + restore-keys: | + ${{ runner.os }}-stack - name: Build server code run: | From e5534b949e3957957a03f67a7b9ceeb7090fda66 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 22:55:06 -0700 Subject: [PATCH 14/20] Remove if checks --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e852f0c..537946ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'created' + # if: github.event_name == 'release' && github.event.action == 'created' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} needs: From e11c65348cf32fbfb51db6efbaca1e36632f3df6 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 23:01:40 -0700 Subject: [PATCH 15/20] Add names to upload-artifact --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 537946ef..91a50f0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: uses: actions/upload-artifact@v2 # if: github.event_name == 'release' && github.event.action == 'created' with: + name: ${{ env.SERVER_ASSET }}.tar.gz path: ${{ env.SERVER_ASSET }}.tar.gz retention-days: 1 @@ -77,6 +78,7 @@ jobs: uses: actions/upload-artifact@v2 # if: github.event_name == 'release' && github.event.action == 'created' with: + name: ${{ env.CLIENT_ASSET }}.tar.gz path: ${{ env.CLIENT_ASSET }}.tar.gz retention-days: 1 From 0f62899d1caf6b6fd982ad8ad0545543862f7814 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 17 Jun 2021 23:04:21 -0700 Subject: [PATCH 16/20] Enable if checks --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91a50f0f..a49bcbf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: timeout 45m stack --no-terminal -j1 build - name: Build server assets - # if: github.event_name == 'release' && github.event.action == 'created' + if: github.event_name == 'release' && github.event.action == 'created' run: | mkdir ${{ env.SERVER_ASSET }} cp $(stack path --dist-dir)/build/trypurescript/trypurescript ${{ env.SERVER_ASSET }}/ @@ -45,7 +45,7 @@ jobs: - name: Persist server assets uses: actions/upload-artifact@v2 - # if: github.event_name == 'release' && github.event.action == 'created' + if: github.event_name == 'release' && github.event.action == 'created' with: name: ${{ env.SERVER_ASSET }}.tar.gz path: ${{ env.SERVER_ASSET }}.tar.gz @@ -67,7 +67,7 @@ jobs: npm run build:production - name: Build client assets - # if: github.event_name == 'release' && github.event.action == 'created' + if: github.event_name == 'release' && github.event.action == 'created' run: | mkdir ${{ env.CLIENT_ASSET }} cp LICENSE ${{ env.CLIENT_ASSET }}/ @@ -76,7 +76,7 @@ jobs: - name: Persist client assets uses: actions/upload-artifact@v2 - # if: github.event_name == 'release' && github.event.action == 'created' + if: github.event_name == 'release' && github.event.action == 'created' with: name: ${{ env.CLIENT_ASSET }}.tar.gz path: ${{ env.CLIENT_ASSET }}.tar.gz @@ -85,7 +85,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - # if: github.event_name == 'release' && github.event.action == 'created' + if: github.event_name == 'release' && github.event.action == 'created' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} needs: From 88698786e42b8e48d3347408e67c7312bfd07996 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Fri, 18 Jun 2021 09:49:47 -0700 Subject: [PATCH 17/20] Pin stack version as is done with the compiler --- .github/workflows/ci.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a49bcbf8..e720b3e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,18 @@ name: CI on: + pull_request: push: branches: [master] - pull_request: + release: + types: [published] + env: SERVER_ASSET: trypurescript-server CLIENT_ASSET: trypurescript-client + CI_RELEASE: "${{ github.event_name == 'release' }}" + jobs: build_server: @@ -15,9 +20,12 @@ jobs: 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 @@ -31,10 +39,10 @@ jobs: - name: Build server code run: | - timeout 45m stack --no-terminal -j1 build + stack --no-terminal -j1 build - name: Build server assets - if: github.event_name == 'release' && github.event.action == 'created' + if: "${{ env.CI_RELEASE == 'true' }}" run: | mkdir ${{ env.SERVER_ASSET }} cp $(stack path --dist-dir)/build/trypurescript/trypurescript ${{ env.SERVER_ASSET }}/ @@ -45,7 +53,7 @@ jobs: - name: Persist server assets uses: actions/upload-artifact@v2 - if: github.event_name == 'release' && github.event.action == 'created' + if: "${{ env.CI_RELEASE == 'true' }}" with: name: ${{ env.SERVER_ASSET }}.tar.gz path: ${{ env.SERVER_ASSET }}.tar.gz @@ -67,7 +75,7 @@ jobs: npm run build:production - name: Build client assets - if: github.event_name == 'release' && github.event.action == 'created' + if: "${{ env.CI_RELEASE == 'true' }}" run: | mkdir ${{ env.CLIENT_ASSET }} cp LICENSE ${{ env.CLIENT_ASSET }}/ @@ -76,7 +84,7 @@ jobs: - name: Persist client assets uses: actions/upload-artifact@v2 - if: github.event_name == 'release' && github.event.action == 'created' + if: "${{ env.CI_RELEASE == 'true' }}" with: name: ${{ env.CLIENT_ASSET }}.tar.gz path: ${{ env.CLIENT_ASSET }}.tar.gz @@ -85,7 +93,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'created' + if: "${{ env.CI_RELEASE == 'true' }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} needs: From 83a44c51260d90f62bc86475c8542a410ded73a8 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Fri, 18 Jun 2021 09:52:06 -0700 Subject: [PATCH 18/20] Update ci.yml --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e720b3e7..7b122088 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,7 @@ on: env: SERVER_ASSET: trypurescript-server CLIENT_ASSET: trypurescript-client - CI_RELEASE: "${{ github.event_name == 'release' }}" - + CI_RELEASE: ${{ github.event_name == 'release' }} jobs: build_server: @@ -42,7 +41,7 @@ jobs: stack --no-terminal -j1 build - name: Build server assets - if: "${{ env.CI_RELEASE == 'true' }}" + if: ${{ env.CI_RELEASE == 'true' }} run: | mkdir ${{ env.SERVER_ASSET }} cp $(stack path --dist-dir)/build/trypurescript/trypurescript ${{ env.SERVER_ASSET }}/ @@ -53,7 +52,7 @@ jobs: - name: Persist server assets uses: actions/upload-artifact@v2 - if: "${{ env.CI_RELEASE == 'true' }}" + if: ${{ env.CI_RELEASE == 'true' }} with: name: ${{ env.SERVER_ASSET }}.tar.gz path: ${{ env.SERVER_ASSET }}.tar.gz @@ -75,7 +74,7 @@ jobs: npm run build:production - name: Build client assets - if: "${{ env.CI_RELEASE == 'true' }}" + if: ${{ env.CI_RELEASE == 'true' }} run: | mkdir ${{ env.CLIENT_ASSET }} cp LICENSE ${{ env.CLIENT_ASSET }}/ @@ -84,7 +83,7 @@ jobs: - name: Persist client assets uses: actions/upload-artifact@v2 - if: "${{ env.CI_RELEASE == 'true' }}" + if: ${{ env.CI_RELEASE == 'true' }} with: name: ${{ env.CLIENT_ASSET }}.tar.gz path: ${{ env.CLIENT_ASSET }}.tar.gz @@ -93,7 +92,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: "${{ env.CI_RELEASE == 'true' }}" + if: ${{ env.CI_RELEASE == 'true' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} needs: From 7a9ef5be6c677f5902b2fe028a2a423ed334393d Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Fri, 18 Jun 2021 09:54:19 -0700 Subject: [PATCH 19/20] Update ci.yml --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b122088..77adc9fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,6 @@ on: env: SERVER_ASSET: trypurescript-server CLIENT_ASSET: trypurescript-client - CI_RELEASE: ${{ github.event_name == 'release' }} jobs: build_server: @@ -41,7 +40,7 @@ jobs: stack --no-terminal -j1 build - name: Build server assets - if: ${{ env.CI_RELEASE == 'true' }} + if: github.event_name == 'release' run: | mkdir ${{ env.SERVER_ASSET }} cp $(stack path --dist-dir)/build/trypurescript/trypurescript ${{ env.SERVER_ASSET }}/ @@ -52,7 +51,7 @@ jobs: - name: Persist server assets uses: actions/upload-artifact@v2 - if: ${{ env.CI_RELEASE == 'true' }} + if: github.event_name == 'release' with: name: ${{ env.SERVER_ASSET }}.tar.gz path: ${{ env.SERVER_ASSET }}.tar.gz @@ -74,7 +73,7 @@ jobs: npm run build:production - name: Build client assets - if: ${{ env.CI_RELEASE == 'true' }} + if: github.event_name == 'release' run: | mkdir ${{ env.CLIENT_ASSET }} cp LICENSE ${{ env.CLIENT_ASSET }}/ @@ -83,7 +82,7 @@ jobs: - name: Persist client assets uses: actions/upload-artifact@v2 - if: ${{ env.CI_RELEASE == 'true' }} + if: github.event_name == 'release' with: name: ${{ env.CLIENT_ASSET }}.tar.gz path: ${{ env.CLIENT_ASSET }}.tar.gz @@ -92,7 +91,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: ${{ env.CI_RELEASE == 'true' }} + if: github.event_name == 'release' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} needs: From b3bb261c125ce6d13cb7d0a5a2964a6ff21dc660 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Fri, 18 Jun 2021 09:57:27 -0700 Subject: [PATCH 20/20] Update changelog --- CHANGELOG.md | 94 ++++++++++++++++++++-------------------------------- 1 file changed, 36 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a7e4eb0..b044b7d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,81 +11,63 @@ New features: Bugfixes: Other improvements: -- Stop mangled 'Compiled ModuleName' output (#228 by @JordanMartinez) -- Update dev instructions: create valid symbolic link across OSes (#226 by @JordanMartinez) + +- Migrated CI to GitHub Actions (#232 by @thomashoneyman) +- Fixed mangled 'Compiled ModuleName' output (#228 by @JordanMartinez) +- Updated dev instructions: create valid symbolic link across OSes (#226 by @JordanMartinez) - Added a changelog (#229 by @JordanMartinez) -- Update PureScript dependency to v0.14.2 (#230 by @JordanMartinez) -- Speed up server slightly by using `rebuildModule'` (#230 by @JordanMartinez) +- Updated PureScript dependency to v0.14.2 (#230 by @JordanMartinez) +- Sped up server slightly by using `rebuildModule'` (#230 by @JordanMartinez) ## [v2021-05-29.1](https://github.com/purescript/trypurescript/releases/tag/v2021-05-29.1) - 2021-05-29 This release officially adds support for PureScript 0.14 to Try PureScript, among many other (largely internal) improvements and updates. -* Updated the compiler and package set for PureScript 0.14 (#209, #213, #224 by @thomashoneyman, #223 by @JordanMartinez) -* Updated local development instructions (#221 by @JordanMartinez, #225 by @thomashoneyman) -* Added support for loading files from GitHub repositories and migrated examples into the Try PureScript repository (#218 by @thomashoneyman) -* Migrated the client to Halogen from JQuery (#215 by @thomashoneyman) -* Migrated the client to `argonaut-codecs` from `foreign-generic` (#212, #217 by @thomashoneyman) -* Migrated the client to `Aff` from `ContT` (#208 by @thomashoneyman) -* Added fixtures to test API responses (#211 by @thomashoneyman) -* Removed unused pragmas, imports, and definitions from server code (#206 by @thomashoneyman) -* Allowed form submission in the Try PureScript iframe (#203 by @mikesol) -* Switch to use a svg favicon with ico fallback (#191 by @milesfrain) -* Implement `encode` in PureScript instead of in FFI (#186 by @maxdeviant) +- Updated the compiler and package set for PureScript 0.14 (#209, #213, #224 by @thomashoneyman, #223 by @JordanMartinez) +- Updated local development instructions (#221 by @JordanMartinez, #225 by @thomashoneyman) +- Added support for loading files from GitHub repositories and migrated examples into the Try PureScript repository (#218 by @thomashoneyman) +- Migrated the client to Halogen from JQuery (#215 by @thomashoneyman) +- Migrated the client to `argonaut-codecs` from `foreign-generic` (#212, #217 by @thomashoneyman) +- Migrated the client to `Aff` from `ContT` (#208 by @thomashoneyman) +- Added fixtures to test API responses (#211 by @thomashoneyman) +- Removed unused pragmas, imports, and definitions from server code (#206 by @thomashoneyman) +- Allowed form submission in the Try PureScript iframe (#203 by @mikesol) +- Switch to use a svg favicon with ico fallback (#191 by @milesfrain) +- Implement `encode` in PureScript instead of in FFI (#186 by @maxdeviant) ## [v2020-07-11.1](https://github.com/purescript/trypurescript/releases/tag/v2020-07-11.1) - 2020-07-11 -* Enable automated SSL certificate renewal (#184, @hdgarrood) -* Remove unused `parsec` dependency (#178, @hdgarrood) -* Only listen on 127.0.0.1 (#177, @hdgarrood) +- Enable automated SSL certificate renewal (#184, @hdgarrood) +- Remove unused `parsec` dependency (#178, @hdgarrood) +- Only listen on 127.0.0.1 (#177, @hdgarrood) ## [v2020-05-26.1](https://github.com/purescript/trypurescript/releases/tag/v2020-05-26.1) - 2020-05-26 -* Update to PureScript v0.13.8 (#175, @hdgarrood -* Make the whole package set available (#173, @hdgarrood, @thomashoneyman) -* Do away with version numbers (#176, @hdgarrood) +- Update to PureScript v0.13.8 (#175, @hdgarrood +- Make the whole package set available (#173, @hdgarrood, @thomashoneyman) +- Do away with version numbers (#176, @hdgarrood) ## [v0.13.7](https://github.com/purescript/trypurescript/releases/tag/v0.13.7) - 2020-05-03 -* Fix help link (#165, @hdgarrood) -* Update API documentation in readme (#168, @hdgarrood) +- Fixed help link (#165, @hdgarrood) +- Update API documentation in readme (#168, @hdgarrood) ## [v0.13.6](https://github.com/purescript/trypurescript/releases/tag/v0.13.6) - 2020-05-03 -* Update to v0.13.6 of the PureScript compiler -* minor tweaks to get deploys working +- Updated to v0.13.6 of the PureScript compiler +- Made minor tweaks to get deploys working ## [v0.13.5](https://github.com/purescript/trypurescript/releases/tag/v0.13.5) - 2020-05-02 -* Update to v0.13.5 of the compiler (@natefaubion) -* Remove backends, serve individual modules on demand (@natefaubion, @gabejohnson, #128, #136) -* Host the client ourselves rather than using GH pages -* Put all source files in one branch (@gabejohnson, #135) -* Fix gist navigation within the iframe (@natefaubion, #140) -* Use different sourceURL syntax per warnings (@natefaubion, #141) -* Switch to spago for managing PS dependencies (@hdgarrood, #147, #150) -* Build the frontend in CI (@hdgarrood, #152) -* Mostly automated deployments (@hdgarrood) - -## [v0.12.0-rc.5](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.5) - 2020-05-02 - -Testing deployment - -## [v0.12.0-rc.4](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.4) - 2020-05-02 - -Testing deployment - -## [v0.12.0-rc.3](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.3) - 2020-05-02 - -Testing deployment - -## [v0.12.0-rc.2](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.2) - 2020-05-02 - -Testing deployment - -## [v0.12.0-rc.1](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.1) - 2020-05-02 - -Mostly for testing the new deployment mechanisms. +- Updated to v0.13.5 of the compiler (@natefaubion) +- Removed backends, now serve individual modules on demand (@natefaubion, @gabejohnson, #128, #136) +- Hosted the client ourselves rather than using GH pages +- Put all source files in one branch (@gabejohnson, #135) +- Fixed gist navigation within the iframe (@natefaubion, #140) +- Used different sourceURL syntax per warnings (@natefaubion, #141) +- Switched to spago for managing PS dependencies (@hdgarrood, #147, #150) +- Built the frontend in CI (@hdgarrood, #152) +- Mostly automated deployments (@hdgarrood) ## [v0.11.7](https://github.com/purescript/trypurescript/releases/tag/v0.11.7) - 2017-11-30 @@ -125,12 +107,8 @@ New version using compiler v0.10.2 ## [v0.9.1.1](https://github.com/purescript/trypurescript/releases/tag/v0.9.1.1) - 2016-06-17 - - ## [v0.9.1](https://github.com/purescript/trypurescript/releases/tag/v0.9.1) - 2016-06-17 - - ## [v0.8.2.0](https://github.com/purescript/trypurescript/releases/tag/v0.8.2.0) - 2016-03-11 Updates for v0.8.2 compiler