Skip to content

Commit a0e00b8

Browse files
authored
Merge pull request #1446 from erlang-ls/upload-artifacts
Add github release.yml to publish binary artifacts
2 parents f323408 + 15b59b5 commit a0e00b8

File tree

1 file changed

+193
-0
lines changed

1 file changed

+193
-0
lines changed

.github/workflows/release.yml

+193
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Release
2+
on:
3+
release:
4+
types:
5+
- created
6+
7+
# Test trigger. Uncomment to test basic flow.
8+
# NOTE: it will fail on trying to get the release url
9+
# on:
10+
# push:
11+
# branches:
12+
# - '*'
13+
14+
jobs:
15+
linux:
16+
strategy:
17+
matrix:
18+
platform: [ubuntu-latest]
19+
otp-version: [23, 24, 25]
20+
runs-on: ${{ matrix.platform }}
21+
container:
22+
image: erlang:${{ matrix.otp-version }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- name: Cache Hex packages
27+
uses: actions/cache@v1
28+
with:
29+
path: ~/.cache/rebar3/hex/hexpm/packages
30+
key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
31+
restore-keys: |
32+
${{ runner.os }}-hex-
33+
- name: Cache Dialyzer PLTs
34+
uses: actions/cache@v1
35+
with:
36+
path: ~/.cache/rebar3/rebar3_*_plt
37+
key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
38+
restore-keys: |
39+
${{ runner.os }}-dialyzer-
40+
- name: Compile
41+
run: rebar3 compile
42+
- name: Escriptize LSP Server
43+
run: rebar3 escriptize
44+
- name: Store LSP Server Escript
45+
uses: actions/upload-artifact@v2
46+
with:
47+
name: erlang_ls
48+
path: _build/default/bin/erlang_ls
49+
- name: Escriptize DAP Server
50+
run: rebar3 as dap escriptize
51+
- name: Store DAP Server Escript
52+
uses: actions/upload-artifact@v2
53+
with:
54+
name: els_dap
55+
path: _build/dap/bin/els_dap
56+
- name: Check formatting
57+
run: rebar3 fmt -c
58+
- name: Lint
59+
run: rebar3 lint
60+
- name: Generate Dialyzer PLT for usage in CT Tests
61+
run: dialyzer --build_plt --apps erts kernel stdlib
62+
- name: Start epmd as daemon
63+
run: epmd -daemon
64+
- name: Run CT Tests
65+
run: rebar3 ct
66+
- name: Store CT Logs
67+
uses: actions/upload-artifact@v2
68+
with:
69+
name: ct-logs
70+
path: _build/test/logs
71+
- name: Run PropEr Tests
72+
run: rebar3 proper --cover --constraint_tries 100
73+
- name: Run Checks
74+
run: rebar3 do dialyzer, xref
75+
- name: Create Cover Reports
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
run: rebar3 do cover, coveralls send
79+
- name: Produce Documentation
80+
run: rebar3 edoc
81+
if: ${{ matrix.otp-version == '24' }}
82+
- name: Publish Documentation
83+
uses: actions/upload-artifact@v2
84+
with:
85+
name: edoc
86+
path: |
87+
apps/els_core/doc
88+
apps/els_lsp/doc
89+
apps/els_dap/doc
90+
91+
# Make release artifacts : erlang_ls
92+
- name: Make erlang_ls-linux.tar.gz
93+
run: 'tar -zcvf erlang_ls-linux-${{ matrix.otp-version }}.tar.gz -C _build/default/bin/ erlang_ls'
94+
- env:
95+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
96+
id: get_release_url
97+
name: Get release url
98+
uses: "bruceadams/[email protected]"
99+
- env:
100+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
101+
name: Upload release erlang_ls.-linux.tar.gz
102+
uses: "actions/[email protected]"
103+
with:
104+
asset_content_type: application/octet-stream
105+
asset_name: "erlang_ls-linux-${{ matrix.otp-version }}.tar.gz"
106+
asset_path: "erlang_ls-linux-${{ matrix.otp-version }}.tar.gz"
107+
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
108+
# Make release artifacts : els_dap
109+
- name: Make els_dap-linux.tar.gz
110+
run: 'tar -zcvf els_dap-linux-${{ matrix.otp-version }}.tar.gz -C _build/dap/bin/ els_dap'
111+
- env:
112+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
113+
name: Upload release els_dap-linux.tar.gz
114+
uses: "actions/[email protected]"
115+
with:
116+
asset_content_type: application/octet-stream
117+
asset_name: "els_dap-linux-${{ matrix.otp-version }}.tar.gz"
118+
asset_path: "els_dap-linux-${{ matrix.otp-version }}.tar.gz"
119+
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
120+
windows:
121+
runs-on: windows-latest
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v2
125+
- name: Install Erlang
126+
run: choco install -y erlang --version 23.3
127+
- name: Install rebar3
128+
run: choco install -y rebar3 --version 3.13.1
129+
- name: Compile
130+
run: rebar3 compile
131+
- name: Escriptize LSP Server
132+
run: rebar3 escriptize
133+
- name: Store LSP Server Escript
134+
uses: actions/upload-artifact@v2
135+
with:
136+
name: erlang_ls
137+
path: _build/default/bin/erlang_ls
138+
- name: Escriptize DAP Server
139+
run: rebar3 as dap escriptize
140+
- name: Store DAP Server Escript
141+
uses: actions/upload-artifact@v2
142+
with:
143+
name: els_dap
144+
path: _build/dap/bin/els_dap
145+
- name: Lint
146+
run: rebar3 lint
147+
- name: Generate Dialyzer PLT for usage in CT Tests
148+
run: dialyzer --build_plt --apps erts kernel stdlib
149+
- name: Start epmd as daemon
150+
run: erl -sname a -noinput -eval "halt(0)."
151+
- name: Run CT Tests
152+
run: rebar3 ct
153+
- name: Store CT Logs
154+
uses: actions/upload-artifact@v2
155+
with:
156+
name: ct-logs
157+
path: _build/test/logs
158+
- name: Run PropEr Tests
159+
run: rebar3 proper --cover --constraint_tries 100
160+
- name: Run Checks
161+
run: rebar3 do dialyzer, xref
162+
- name: Produce Documentation
163+
run: rebar3 edoc
164+
165+
# Make release artifacts : erlang_ls
166+
- name: Make erlang_ls-win32.tar.gz
167+
run: 'tar -zcvf erlang_ls-win32.tar.gz -C _build/default/bin/ erlang_ls'
168+
- env:
169+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
170+
id: get_release_url
171+
name: Get release url
172+
uses: "bruceadams/[email protected]"
173+
- env:
174+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
175+
name: Upload release erlang_ls.-win32.tar.gz
176+
uses: "actions/[email protected]"
177+
with:
178+
asset_content_type: application/octet-stream
179+
asset_name: erlang_ls-win32.tar.gz
180+
asset_path: erlang_ls-win32.tar.gz
181+
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
182+
# Make release artifacts : els_dap
183+
- name: Make els_dap-win32.tar.gz
184+
run: 'tar -zcvf els_dap-win32.tar.gz -C _build/dap/bin/ els_dap'
185+
- env:
186+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
187+
name: Upload release els_dap-win32.tar.gz
188+
uses: "actions/[email protected]"
189+
with:
190+
asset_content_type: application/octet-stream
191+
asset_name: els_dap-win32.tar.gz
192+
asset_path: els_dap-win32.tar.gz
193+
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"

0 commit comments

Comments
 (0)