-
Notifications
You must be signed in to change notification settings - Fork 8
184 lines (178 loc) · 5.02 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Build
on:
push:
branches:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set output
id: vars
run: |
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 24.3.4
elixir-version: 1.14.2
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 18.12.1
- name: Install Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile
run: |
mix compile
- name: Test
run: |
mix test
env:
MIX_ENV: test
- name: Compile Web Assets
run: |
yarn install --cwd assets
mix assets.deploy
env:
MIX_ENV: prod
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
- name: mix release
run: |
mix release
env:
MIX_ENV: prod
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
- name: Compress files
uses: master-atul/tar-action@v1.1.2
with:
command: c
cwd: ./_build/prod/rel
files: |
./open890
outPath: /tmp/open890-${{ steps.vars.outputs.TAG }}-ubuntu-x64.tar.gz
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set output
id: vars
run: |
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Install asdf via homebrew
run: |
brew install asdf coreutils automake autoconf libyaml readline libxslt libtool
brew install openssl@1.1
mkdir -p ~/.asdf/installs/erlang
- name: Show openssl prefix
run: |
brew --prefix openssl@1.1
- name: Action-cache asdf erlang build
uses: actions/cache@v3
with:
path: ~/.asdf/installs/erlang
key: ${{ runner.os }}-${{ hashFiles('.tool-versions') }}
- name: Install OTP and Elixir via asdf
env:
KERL_CONFIGURE_OPTIONS: "--disable-dynamic-ssl-lib --without-javac --with-ssl=/usr/local/opt/openssl@1.1"
run: |
make install_tools
asdf reshim erlang
- name: Install Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
export PATH=~/.asdf/shims:$PATH
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile
run: |
export PATH=~/.asdf/shims:$PATH
mix compile
- name: Test
run: |
export PATH=~/.asdf/shims:$PATH
mix test
env:
MIX_ENV: test
- name: Compile Web Assets
run: |
export PATH=~/.asdf/shims:$PATH
yarn install --cwd assets
mix assets.deploy
env:
MIX_ENV: prod
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
- name: mix release
run: |
export PATH=~/.asdf/shims:$PATH
mix release
env:
MIX_ENV: prod
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set output
shell: bash
id: vars
run: |
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Install Erlang and Elixir
env:
ERLANG_VERSION: 24.3.4
ELIXIR_VERSION: 1.14.2
run: |
build_scripts\win64\install_elixir.ps1;
echo "c:\erlang\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
echo "c:\elixir\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Install node dependencies
working-directory: assets
run: |
yarn install --cwd assets
env:
MIX_ENV: prod
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
- name: Compile
run: |
mix compile
- name: Test
run: |
mix test
env:
MIX_ENV: test
- name: mix assets.deploy.windows
run: |
mix assets.deploy.windows
env:
MIX_ENV: prod
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
- name: mix release
run: |
mix release
env:
MIX_ENV: prod
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}