Skip to content

Commit 8bbba37

Browse files
Migrate to GitHub Actions (#232)
1 parent 88a3db8 commit 8bbba37

File tree

6 files changed

+152
-155
lines changed

6 files changed

+152
-155
lines changed

.github/workflows/ci.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
release:
8+
types: [published]
9+
10+
11+
env:
12+
SERVER_ASSET: trypurescript-server
13+
CLIENT_ASSET: trypurescript-client
14+
15+
jobs:
16+
build_server:
17+
name: Build server
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- uses: haskell/actions/setup@v1
23+
with:
24+
enable-stack: true
25+
stack-version: "2.5.1"
26+
stack-no-global: true
27+
28+
- name: Cache dependencies
29+
uses: actions/cache@v2
30+
with:
31+
path: |
32+
~/.stack
33+
.stack-work
34+
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-stack
37+
38+
- name: Build server code
39+
run: |
40+
stack --no-terminal -j1 build
41+
42+
- name: Build server assets
43+
if: github.event_name == 'release'
44+
run: |
45+
mkdir ${{ env.SERVER_ASSET }}
46+
cp $(stack path --dist-dir)/build/trypurescript/trypurescript ${{ env.SERVER_ASSET }}/
47+
cp LICENSE ${{ env.SERVER_ASSET }}/
48+
cp -r deploy/ ${{ env.SERVER_ASSET }}/
49+
cp -r staging/ ${{ env.SERVER_ASSET}}/
50+
tar czf ${{ env.SERVER_ASSET }}.tar.gz -C ${{ env.SERVER_ASSET }}/ .
51+
52+
- name: Persist server assets
53+
uses: actions/upload-artifact@v2
54+
if: github.event_name == 'release'
55+
with:
56+
name: ${{ env.SERVER_ASSET }}.tar.gz
57+
path: ${{ env.SERVER_ASSET }}.tar.gz
58+
retention-days: 1
59+
60+
build_client:
61+
name: Build client
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v2
65+
- uses: actions/setup-node@v2
66+
67+
- name: Build client code
68+
run: |
69+
cd client
70+
npm install
71+
npm run build
72+
npm run test
73+
npm run build:production
74+
75+
- name: Build client assets
76+
if: github.event_name == 'release'
77+
run: |
78+
mkdir ${{ env.CLIENT_ASSET }}
79+
cp LICENSE ${{ env.CLIENT_ASSET }}/
80+
cp -r client/public/ ${{ env.CLIENT_ASSET }}/
81+
tar czf ${{ env.CLIENT_ASSET }}.tar.gz -C ${{ env.CLIENT_ASSET }}/ .
82+
83+
- name: Persist client assets
84+
uses: actions/upload-artifact@v2
85+
if: github.event_name == 'release'
86+
with:
87+
name: ${{ env.CLIENT_ASSET }}.tar.gz
88+
path: ${{ env.CLIENT_ASSET }}.tar.gz
89+
retention-days: 1
90+
91+
release:
92+
name: Release
93+
runs-on: ubuntu-latest
94+
if: github.event_name == 'release'
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
needs:
98+
- build_server
99+
- build_client
100+
steps:
101+
- name: Retrieve server assets
102+
uses: actions/download-artifact@v2
103+
with:
104+
name: ${{ env.SERVER_ASSET }}.tar.gz
105+
106+
- name: Retrieve client assets
107+
uses: actions/download-artifact@v2
108+
with:
109+
name: ${{ env.CLIENT_ASSET }}.tar.gz
110+
111+
- name: Upload server and client assets
112+
uses: softprops/action-gh-release@v1
113+
with:
114+
files: |
115+
${{ env.SERVER_ASSET }}.tar.gz
116+
${{ env.CLIENT_ASSET }}.tar.gz

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 36 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,81 +11,63 @@ New features:
1111
Bugfixes:
1212

1313
Other improvements:
14-
- Stop mangled 'Compiled ModuleName' output (#228 by @JordanMartinez)
15-
- Update dev instructions: create valid symbolic link across OSes (#226 by @JordanMartinez)
14+
15+
- Migrated CI to GitHub Actions (#232 by @thomashoneyman)
16+
- Fixed mangled 'Compiled ModuleName' output (#228 by @JordanMartinez)
17+
- Updated dev instructions: create valid symbolic link across OSes (#226 by @JordanMartinez)
1618
- Added a changelog (#229 by @JordanMartinez)
17-
- Update PureScript dependency to v0.14.2 (#230 by @JordanMartinez)
18-
- Speed up server slightly by using `rebuildModule'` (#230 by @JordanMartinez)
19+
- Updated PureScript dependency to v0.14.2 (#230 by @JordanMartinez)
20+
- Sped up server slightly by using `rebuildModule'` (#230 by @JordanMartinez)
1921

2022
## [v2021-05-29.1](https://github.com/purescript/trypurescript/releases/tag/v2021-05-29.1) - 2021-05-29
2123

2224
This release officially adds support for PureScript 0.14 to Try PureScript, among many other (largely internal) improvements and updates.
2325

24-
* Updated the compiler and package set for PureScript 0.14 (#209, #213, #224 by @thomashoneyman, #223 by @JordanMartinez)
25-
* Updated local development instructions (#221 by @JordanMartinez, #225 by @thomashoneyman)
26-
* Added support for loading files from GitHub repositories and migrated examples into the Try PureScript repository (#218 by @thomashoneyman)
27-
* Migrated the client to Halogen from JQuery (#215 by @thomashoneyman)
28-
* Migrated the client to `argonaut-codecs` from `foreign-generic` (#212, #217 by @thomashoneyman)
29-
* Migrated the client to `Aff` from `ContT` (#208 by @thomashoneyman)
30-
* Added fixtures to test API responses (#211 by @thomashoneyman)
31-
* Removed unused pragmas, imports, and definitions from server code (#206 by @thomashoneyman)
32-
* Allowed form submission in the Try PureScript iframe (#203 by @mikesol)
33-
* Switch to use a svg favicon with ico fallback (#191 by @milesfrain)
34-
* Implement `encode` in PureScript instead of in FFI (#186 by @maxdeviant)
26+
- Updated the compiler and package set for PureScript 0.14 (#209, #213, #224 by @thomashoneyman, #223 by @JordanMartinez)
27+
- Updated local development instructions (#221 by @JordanMartinez, #225 by @thomashoneyman)
28+
- Added support for loading files from GitHub repositories and migrated examples into the Try PureScript repository (#218 by @thomashoneyman)
29+
- Migrated the client to Halogen from JQuery (#215 by @thomashoneyman)
30+
- Migrated the client to `argonaut-codecs` from `foreign-generic` (#212, #217 by @thomashoneyman)
31+
- Migrated the client to `Aff` from `ContT` (#208 by @thomashoneyman)
32+
- Added fixtures to test API responses (#211 by @thomashoneyman)
33+
- Removed unused pragmas, imports, and definitions from server code (#206 by @thomashoneyman)
34+
- Allowed form submission in the Try PureScript iframe (#203 by @mikesol)
35+
- Switch to use a svg favicon with ico fallback (#191 by @milesfrain)
36+
- Implement `encode` in PureScript instead of in FFI (#186 by @maxdeviant)
3537

3638
## [v2020-07-11.1](https://github.com/purescript/trypurescript/releases/tag/v2020-07-11.1) - 2020-07-11
3739

38-
* Enable automated SSL certificate renewal (#184, @hdgarrood)
39-
* Remove unused `parsec` dependency (#178, @hdgarrood)
40-
* Only listen on 127.0.0.1 (#177, @hdgarrood)
40+
- Enable automated SSL certificate renewal (#184, @hdgarrood)
41+
- Remove unused `parsec` dependency (#178, @hdgarrood)
42+
- Only listen on 127.0.0.1 (#177, @hdgarrood)
4143

4244
## [v2020-05-26.1](https://github.com/purescript/trypurescript/releases/tag/v2020-05-26.1) - 2020-05-26
4345

44-
* Update to PureScript v0.13.8 (#175, @hdgarrood
45-
* Make the whole package set available (#173, @hdgarrood, @thomashoneyman)
46-
* Do away with version numbers (#176, @hdgarrood)
46+
- Update to PureScript v0.13.8 (#175, @hdgarrood
47+
- Make the whole package set available (#173, @hdgarrood, @thomashoneyman)
48+
- Do away with version numbers (#176, @hdgarrood)
4749

4850
## [v0.13.7](https://github.com/purescript/trypurescript/releases/tag/v0.13.7) - 2020-05-03
4951

50-
* Fix help link (#165, @hdgarrood)
51-
* Update API documentation in readme (#168, @hdgarrood)
52+
- Fixed help link (#165, @hdgarrood)
53+
- Update API documentation in readme (#168, @hdgarrood)
5254

5355
## [v0.13.6](https://github.com/purescript/trypurescript/releases/tag/v0.13.6) - 2020-05-03
5456

55-
* Update to v0.13.6 of the PureScript compiler
56-
* minor tweaks to get deploys working
57+
- Updated to v0.13.6 of the PureScript compiler
58+
- Made minor tweaks to get deploys working
5759

5860
## [v0.13.5](https://github.com/purescript/trypurescript/releases/tag/v0.13.5) - 2020-05-02
5961

60-
* Update to v0.13.5 of the compiler (@natefaubion)
61-
* Remove backends, serve individual modules on demand (@natefaubion, @gabejohnson, #128, #136)
62-
* Host the client ourselves rather than using GH pages
63-
* Put all source files in one branch (@gabejohnson, #135)
64-
* Fix gist navigation within the iframe (@natefaubion, #140)
65-
* Use different sourceURL syntax per warnings (@natefaubion, #141)
66-
* Switch to spago for managing PS dependencies (@hdgarrood, #147, #150)
67-
* Build the frontend in CI (@hdgarrood, #152)
68-
* Mostly automated deployments (@hdgarrood)
69-
70-
## [v0.12.0-rc.5](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.5) - 2020-05-02
71-
72-
Testing deployment
73-
74-
## [v0.12.0-rc.4](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.4) - 2020-05-02
75-
76-
Testing deployment
77-
78-
## [v0.12.0-rc.3](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.3) - 2020-05-02
79-
80-
Testing deployment
81-
82-
## [v0.12.0-rc.2](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.2) - 2020-05-02
83-
84-
Testing deployment
85-
86-
## [v0.12.0-rc.1](https://github.com/purescript/trypurescript/releases/tag/v0.12.0-rc.1) - 2020-05-02
87-
88-
Mostly for testing the new deployment mechanisms.
62+
- Updated to v0.13.5 of the compiler (@natefaubion)
63+
- Removed backends, now serve individual modules on demand (@natefaubion, @gabejohnson, #128, #136)
64+
- Hosted the client ourselves rather than using GH pages
65+
- Put all source files in one branch (@gabejohnson, #135)
66+
- Fixed gist navigation within the iframe (@natefaubion, #140)
67+
- Used different sourceURL syntax per warnings (@natefaubion, #141)
68+
- Switched to spago for managing PS dependencies (@hdgarrood, #147, #150)
69+
- Built the frontend in CI (@hdgarrood, #152)
70+
- Mostly automated deployments (@hdgarrood)
8971

9072
## [v0.11.7](https://github.com/purescript/trypurescript/releases/tag/v0.11.7) - 2017-11-30
9173

@@ -125,12 +107,8 @@ New version using compiler v0.10.2
125107

126108
## [v0.9.1.1](https://github.com/purescript/trypurescript/releases/tag/v0.9.1.1) - 2016-06-17
127109

128-
129-
130110
## [v0.9.1](https://github.com/purescript/trypurescript/releases/tag/v0.9.1) - 2016-06-17
131111

132-
133-
134112
## [v0.8.2.0](https://github.com/purescript/trypurescript/releases/tag/v0.8.2.0) - 2016-03-11
135113

136114
Updates for v0.8.2 compiler

ci/before_deploy.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

ci/build.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

client/.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)