-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (82 loc) · 2.77 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This is a basic workflow to help you get started with Actions
name: RELEASE
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
push:
branches: master
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Build
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [macos-latest, ubuntu-latest]
ocaml-version: [ '4.6.1000' ]
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install esy
run: npm install -g esy@latest cross-env
- name: Restore Cache
id: restore-cache
uses: actions/cache@v2
with:
path: _export
key: ${{ matrix.operating-system }}-esy-${{ hashFiles('properties/esy.lock/index.json') }}
restore-keys: |
${{ matrix.operating-system }}-esy-
- name: Build with cache=
run: |
cd properties
esy install
esy import-dependencies _export
rm -rf _export
esy build
- name: Setting dependency cache
run: |
cd properties
esy export-dependencies
if: steps.restore-cache.outputs.cache-hit != 'true'
- name: Upload Artifacts
uses: 'actions/upload-artifact@v2'
with:
name: artifact-${{ matrix.operating-system }}
path: properties/_build/default/ppx/ppx.exe
publish:
needs: build
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Download linux artifacts
uses: actions/download-artifact@v2
with:
name: artifact-ubuntu-latest
path: properties/binaries/linux
- name: Download macos artifacts
uses: actions/download-artifact@v2
with:
name: artifact-macos-latest
path: properties/binaries/darwin
- name: Move artifacts
run: |
mv properties/binaries/darwin/ppx.exe ppx-properties-darwin-x64.exe
mv properties/binaries/linux/ppx.exe ppx-properties-linux-x64.exe
rm -rf properties/binaries
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply automatic changes
# Optional options appended to `git-commit`
# Optional glob pattern of files which should be added to the commit
file_pattern: ppx-properties-*.exe
# Optional options appended to `git-push`
push_options: '--force'