Build Release #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-${{ runner.os }}.tar.gz | |
env: | |
MIX_ENV: prod | |
- name: Upload artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: lichat-${{ runner.os }} | |
path: lichat-${{ runner.os }}.tar.gz | |
- name: Create release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
name: Release ${{ github.ref }} | |
artifacts: lichat-${{ runner.os }}.tar.gz |