-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: macos-latest | ||
target: x86_64-apple-darwin | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
elixir-version: '1.15.7' | ||
otp-version: '26.0' | ||
version-type: 'loose' | ||
|
||
- name: Restore deps cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: | ||
${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }}-git-${{ | ||
github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }} | ||
${{ runner.os }}-deps | ||
- name: Install Dependencies | ||
run: | | ||
mix local.hex --force | ||
mix local.rebar --force | ||
mix deps.get | ||
- name: Remove compiled files | ||
run: mix clean | ||
|
||
- name: Compile dependencies | ||
run: mix compile | ||
env: | ||
MIX_ENV: test | ||
|
||
- name: Run release build | ||
env: | ||
MIX_ENV: prod | ||
run: mix release | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: interpolation_cli-${{ matrix.os }} | ||
path: _build/prod/rel/interpolation_cli | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: interpolation_cli-${{ matrix.os }} | ||
path: release | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: release/** | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |