This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (83 loc) · 2.72 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- v*.*.**
workflow_dispatch:
jobs:
build_binary:
name: Build the cli binary
strategy:
matrix:
# os: [windows-latest, ubuntu-20.04, ubuntu-18.04, macos-12, macos-12-m1]
os: [ubuntu-18.04, macos-12, macos-12-m1]
runs-on: ${{ matrix.os }}
env:
MIX_ENV: prod
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git log --oneline -30
- uses: erlef/setup-beam@v1
if: ${{ !startsWith(matrix.os, 'macos')}}
with:
otp-version: 24.3
elixir-version: 1.14
- name: Install build tools on windows
if: ${{ startsWith(matrix.os, 'windows')}}
run: |
choco install -y zstandard make
Add-Content -Path $env:GITHUB_ENV -Value "CC=gcc"
- name: Setup elixir on mac
if: ${{ startsWith(matrix.os, 'macos')}}
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "true"
run: |
brew update --preinstall
brew install erlang@25
brew install elixir
mix local.hex --force
mix local.rebar --force
- name: Setup dependency caching
if: ${{ startsWith(matrix.os, 'macos')}}
uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashfiles('**/mix.lock')}}
restore-keys: |
${{ runner.os }}-mix-
- run: mix deps.get
- run: mix release
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-binary
path: _build/prod/rel/bakeware/electric
create_draft_release:
name: Create a draft release with all the binaries
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-20.04
needs: build_binary
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
path: ./
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: |
mv ubuntu-18.04-binary/electric electricsql_cli_${{ env.RELEASE_VERSION }}_linux
mv macos-12-binary/electric electricsql_cli_${{ env.RELEASE_VERSION }}_intel_mac
mv macos-12-m1-binary/electric electricsql_cli_${{ env.RELEASE_VERSION }}_arm_mac
chmod +x electricsql_cli_*
- name: Publish the release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
files: |
electricsql_cli_${{ env.RELEASE_VERSION }}_arm_mac
electricsql_cli_${{ env.RELEASE_VERSION }}_intel_mac
electricsql_cli_${{ env.RELEASE_VERSION }}_linux