-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (55 loc) · 1.73 KB
/
release.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
name: Build Release
on: [create, workflow_dispatch]
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Create empty secrets file
run: touch config/secret.exs
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.15.0'
otp-version: '25'
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
deps
_build/prod/lib/
key: ${{ runner.os }}-otp25-ex1.15.0-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-otp25-ex1.15.0-${{ hashFiles('**/mix.lock') }}
- name: Install dependencies
run: mix deps.get
- name: Compile release
run: |
mix compile
mix distillery.release
cp _build/prod/rel/lichat/releases/*/lichat.tar.gz lichat.tar.gz
env:
MIX_ENV: prod
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: lichat-${{ runner.os }}
path: lichat.tar.gz
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref }}
skipIfReleaseExists: true
- name: Upload release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: lichat.tar.gz
asset_name: lichat-${{ runner.os }}.tar.gz
asset_content_type: application/gzip