mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Standardize Elixir & OTP versions (#1979)
This commit is contained in:
parent
d5f9aaf14e
commit
590ed206af
11
.github/scripts/app/build_macos.sh
vendored
11
.github/scripts/app/build_macos.sh
vendored
|
@ -15,6 +15,11 @@
|
|||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
. versions
|
||||
OTP_VERSION="${OTP_VERSION:-$otp}"
|
||||
ELIXIR_VERSION="${ELIXIR_VERSION:-$elixir}"
|
||||
OPENSSL_VERSION="${OPENSSL_VERSION:-$openssl}"
|
||||
|
||||
bootstrap_otp
|
||||
download_elixir
|
||||
build_app
|
||||
|
@ -23,16 +28,16 @@ main() {
|
|||
bootstrap_otp() {
|
||||
dir=$PWD
|
||||
cd elixirkit/otp_bootstrap
|
||||
. ./build_macos_universal.sh $OTP_VERSION "1.1.1s"
|
||||
. ./build_macos_universal.sh "$OTP_VERSION" "$OPENSSL_VERSION"
|
||||
cd $dir
|
||||
}
|
||||
|
||||
download_elixir() {
|
||||
dir=$PWD
|
||||
elixir_dir=$PWD/_build/elixir-$ELIXIR_VERSION
|
||||
elixir_dir=$PWD/_build/elixir-"$ELIXIR_VERSION"
|
||||
|
||||
if [ ! -d $elixir_dir ]; then
|
||||
otp_release=$(erl -noshell -eval 'io:format("~s", [erlang:system_info(otp_release)]), halt().')
|
||||
otp_release=`erl -noshell -eval 'io:format("~s", [erlang:system_info(otp_release)]), halt().'`
|
||||
elixir_zip=v${ELIXIR_VERSION}-otp-${otp_release}.zip
|
||||
url=https://builds.hex.pm/builds/elixir/$elixir_zip
|
||||
echo downloading $url
|
||||
|
|
7
.github/workflows/deploy.yml
vendored
7
.github/workflows/deploy.yml
vendored
|
@ -5,9 +5,6 @@ on:
|
|||
- main
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
env:
|
||||
otp: "25.3.2"
|
||||
elixir: "1.15.0-rc.2"
|
||||
jobs:
|
||||
assets:
|
||||
outputs:
|
||||
|
@ -15,6 +12,10 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: |
|
||||
. versions
|
||||
echo "elixir=$elixir" >> $GITHUB_ENV
|
||||
echo "otp=$otp" >> $GITHUB_ENV
|
||||
- name: Install Erlang & Elixir
|
||||
uses: erlef/setup-beam@v1
|
||||
with:
|
||||
|
|
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
|
@ -4,16 +4,19 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- main
|
||||
env:
|
||||
otp: "25.3.2"
|
||||
elixir: "1.15.0-rc.2"
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
MIX_ENV: test
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout git repo
|
||||
uses: actions/checkout@v3
|
||||
- run: |
|
||||
. versions
|
||||
echo "elixir=$elixir" >> $GITHUB_ENV
|
||||
echo "otp=$otp" >> $GITHUB_ENV
|
||||
echo "openssl=$openssl" >> $GITHUB_ENV
|
||||
- name: Install Erlang & Elixir
|
||||
uses: erlef/setup-beam@v1
|
||||
with:
|
||||
|
@ -55,13 +58,19 @@ jobs:
|
|||
run: npm test --prefix assets
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: github.ref_name == 'main'
|
||||
env:
|
||||
MIX_ENV: test
|
||||
steps:
|
||||
- name: Configure Git
|
||||
run: git config --global core.autocrlf input
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout git repo
|
||||
uses: actions/checkout@v3
|
||||
- run: |
|
||||
. versions
|
||||
echo "elixir=$elixir" >> $GITHUB_ENV
|
||||
echo "otp=$otp" >> $GITHUB_ENV
|
||||
echo "openssl=$openssl" >> $GITHUB_ENV
|
||||
- name: Install Erlang & Elixir
|
||||
uses: erlef/setup-beam@v1
|
||||
with:
|
||||
|
@ -93,9 +102,15 @@ jobs:
|
|||
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: github.ref_name == 'main'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout git repo
|
||||
uses: actions/checkout@v3
|
||||
- run: |
|
||||
. versions
|
||||
echo "elixir=$elixir" >> $GITHUB_ENV
|
||||
echo "otp=$otp" >> $GITHUB_ENV
|
||||
echo "openssl=$openssl" >> $GITHUB_ENV
|
||||
- name: Cache Mix Deps
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
|
@ -104,7 +119,7 @@ jobs:
|
|||
- name: Cache Bootstrap OTP
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: elixirkit/otp_bootstrap/_build/otp-rel-${{ env.otp }}-openssl-1.1.1s-macos-universal
|
||||
path: elixirkit/otp_bootstrap/_build/otp-rel-${{ env.otp }}-openssl-${{ env.openssl }}-macos-universal
|
||||
key: ${{ runner.os }}-bootstrap-${{ env.otp }}-${{ hashFiles('elixirkit/otp_bootstrap/build.sh') }}
|
||||
- name: Cache Elixir
|
||||
uses: actions/cache@v3
|
||||
|
@ -113,6 +128,3 @@ jobs:
|
|||
key: ${{ runner.os }}-elixir-${{ env.elixir }}
|
||||
- name: Build the app
|
||||
run: .github/scripts/app/build_macos.sh
|
||||
env:
|
||||
OTP_VERSION: ${{ env.otp }}
|
||||
ELIXIR_VERSION: ${{ env.elixir }}
|
||||
|
|
8
.github/workflows/uffizzi-build.yml
vendored
8
.github/workflows/uffizzi-build.yml
vendored
|
@ -3,10 +3,6 @@ on:
|
|||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
|
||||
env:
|
||||
otp: "25.3.2"
|
||||
elixir: "1.15.0-rc.2"
|
||||
|
||||
jobs:
|
||||
build-application:
|
||||
name: Build PR image
|
||||
|
@ -17,6 +13,10 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout git repo
|
||||
uses: actions/checkout@v3
|
||||
- run: |
|
||||
. versions
|
||||
echo "elixir=$elixir" >> $GITHUB_ENV
|
||||
echo "otp=$otp" >> $GITHUB_ENV
|
||||
# --- START build assets
|
||||
- name: Install Erlang & Elixir
|
||||
uses: erlef/setup-beam@v1
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
set -ex
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
elixir="1.15.0-rc.2"
|
||||
erlang="25.3.2"
|
||||
. versions
|
||||
ubuntu="focal-20230126"
|
||||
|
||||
docker buildx build --push --platform linux/amd64,linux/arm64 \
|
||||
-t ghcr.io/livebook-dev/utils:elixir-cuda11.8 \
|
||||
--build-arg ELIXIR_VERSION=$elixir \
|
||||
--build-arg ERLANG_VERSION=$erlang \
|
||||
--build-arg ERLANG_VERSION=$otp \
|
||||
--build-arg UBUNTU_VERSION=$ubuntu \
|
||||
--build-arg CUDA_VERSION=11.8.0 \
|
||||
-f docker/base/elixir-cuda.dockerfile \
|
||||
|
|
11
mix.exs
11
mix.exs
|
@ -5,9 +5,6 @@ defmodule Livebook.MixProject do
|
|||
@version "0.9.2"
|
||||
@description "Automate code & data workflows with interactive notebooks"
|
||||
|
||||
@app_elixir_version "1.15.0-rc.2"
|
||||
@app_rebar3_version "3.22.0"
|
||||
|
||||
def project do
|
||||
[
|
||||
app: :livebook,
|
||||
|
@ -164,12 +161,16 @@ defmodule Livebook.MixProject do
|
|||
@compile {:no_warn_undefined, Standalone}
|
||||
|
||||
defp standalone_erlang_elixir(release) do
|
||||
{_, bindings} = Code.eval_file("versions")
|
||||
elixir_version = bindings[:elixir]
|
||||
rebar3_version = bindings[:rebar3]
|
||||
|
||||
Code.require_file("rel/app/standalone.exs")
|
||||
|
||||
release
|
||||
|> Standalone.copy_otp()
|
||||
|> Standalone.copy_elixir(@app_elixir_version)
|
||||
|> Standalone.copy_elixir(elixir_version)
|
||||
|> Standalone.copy_hex()
|
||||
|> Standalone.copy_rebar3(@app_rebar3_version)
|
||||
|> Standalone.copy_rebar3(rebar3_version)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue