This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
89 lines (79 loc) · 2.55 KB
/
build-binaries.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
name: Build and Release Binaries
on:
push:
tags:
- "v*.*.*" # Triggers on version tag pushes like v1.0.0
jobs:
build:
name: Build Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
platform: linux
arch: x86_64
- os: macos-latest
platform: macos
arch: x86_64
- os: windows-latest
platform: windows
arch: x86_64
steps:
- name: Checkout Code
uses: actions/checkout@v3
# Set up Elixir and Erlang/OTP
- name: Set Up Elixir (Ubuntu and Windows)
if: runner.os != 'macOS'
uses: erlef/setup-beam@v1
with:
elixir-version: "1.17.2"
otp-version: "26"
- name: Install Elixir and Erlang (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install [email protected]
- name: Install Dependencies
run: mix deps.get
- name: Build Release
env:
MIX_ENV: prod
run: mix release
- name: Prepare Artifact (Linux and macOS)
if: runner.os != 'Windows'
run: |
tar czvf cashubrew-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz -C _build/prod/rel/cashubrew .
- name: Prepare Artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Compress-Archive -Path "_build\prod\rel\cashubrew\*" -DestinationPath "cashubrew-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.ref_name }}.zip"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: cashubrew-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.ref_name }}
path: |
cashubrew-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz
cashubrew-${{ matrix.platform }}-${{ matrix.arch }}-${{ github.ref_name }}.zip
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/*
draft: false
prerelease: false
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}