Skip to content

🔧 ci: New release workflow #4

🔧 ci: New release workflow

🔧 ci: New release workflow #4

Workflow file for this run

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 }}