forked from elixir-lsp/elixir-ls
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (90 loc) · 2.79 KB
/
release-asset.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
name: Elixir CI
on:
push:
tags:
- 'v*'
jobs:
release:
name: Create draft release
runs-on: ubuntu-20.04
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
build:
name: Build and publish release asset
runs-on: ubuntu-20.04
needs: release
strategy:
matrix:
include:
- elixir-version: '1.14'
otp-version: '25.1'
- elixir-version: '1.14'
otp-version: '24.3'
- elixir-version: '1.14'
otp-version: '23.3'
- elixir-version: '1.13'
otp-version: '25.1'
- elixir-version: '1.13'
otp-version: '24.3'
- elixir-version: '1.13'
otp-version: '23.3'
- elixir-version: '1.13'
otp-version: '22.3'
- elixir-version: '1.12'
otp-version: '24.3'
- elixir-version: '1.12'
otp-version: '23.3'
- elixir-version: '1.12'
otp-version: '22.3'
default: true
steps:
- uses: actions/checkout@v3
- name: Set up BEAM
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Build release
run: |
mkdir ./release
mix compile
MIX_ENV=prod mix elixir_ls.release -o ./release
zip -jr elixir-ls.zip ./release
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./elixir-ls.zip
asset_name: elixir-ls-${{ matrix.elixir-version }}-${{ matrix.otp-version }}.zip
asset_content_type: application/zip
- name: Upload Default Release Asset
if: ${{ matrix.default == true }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./elixir-ls.zip
asset_name: elixir-ls.zip
asset_content_type: application/zip