Skip to content

Commit f5b6ddb

Browse files
fix(deps): upgrade to Elixir 1.12.3 and Erlang 24.3.4.6 (#719)
Signed-off-by: David van der Spek <[email protected]> Co-authored-by: michaeljguarino <[email protected]>
1 parent cbc9e3e commit f5b6ddb

File tree

11 files changed

+56
-34
lines changed

11 files changed

+56
-34
lines changed

.github/workflows/publish.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: erlef/setup-beam@v1
1414
with:
15-
elixir-version: '1.11.4' # Define the elixir version [required]
16-
otp-version: '23.3' # Define the OTP version [required]
15+
version-file: .tool-versions
16+
version-type: strict
1717
- uses: azure/setup-helm@v3
1818
with:
1919
version: latest
@@ -28,14 +28,14 @@ jobs:
2828
uses: actions/cache@v3
2929
with:
3030
path: deps
31-
key: ${{ runner.os }}-mix-5-${{ hashFiles('**/mix.lock') }}
32-
restore-keys: ${{ runner.os }}-mix-5
31+
key: ${{ runner.os }}-mix-6-${{ hashFiles('**/mix.lock') }}
32+
restore-keys: ${{ runner.os }}-mix-6
3333
- name: Restore _build
3434
uses: actions/cache@v3
3535
with:
3636
path: _build
37-
key: ${{ runner.os }}-mix-5-${{ hashFiles('**/mix.lock') }}
38-
restore-keys: ${{ runner.os }}-mix-5
37+
key: ${{ runner.os }}-mix-6-${{ hashFiles('**/mix.lock') }}
38+
restore-keys: ${{ runner.os }}-mix-6
3939
- run: mix deps.get
4040
- run: mix test
4141
- uses: 8398a7/action-slack@v3

.github/workflows/test.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
strategy:
3636
matrix:
3737
app: [ plural, cron, worker, rtc ]
38+
permissions:
39+
contents: 'read'
40+
id-token: 'write'
41+
packages: 'write'
3842
steps:
3943
- name: Checkout
4044
uses: actions/checkout@v3
@@ -47,22 +51,28 @@ jobs:
4751
# list of Docker images to use as base name for tags
4852
images: |
4953
ghcr.io/pluralsh/${{ matrix.app }}
50-
dkr.plural.sh/plural/${{ matrix.app }}
51-
gcr.io/pluralsh/${{ matrix.app }}
5254
# generate Docker tags based on the following events/attributes
5355
tags: |
5456
type=sha
57+
type=ref,event=pr
58+
type=ref,event=branch
5559
- name: Set up QEMU
5660
uses: docker/setup-qemu-action@v2
5761
- name: Set up Docker Buildx
5862
uses: docker/setup-buildx-action@v2
63+
- name: Login to GHCR
64+
uses: docker/login-action@v2
65+
with:
66+
registry: ghcr.io
67+
username: ${{ github.repository_owner }}
68+
password: ${{ secrets.GITHUB_TOKEN }}
5969
- name: Test Build ${{ matrix.app }} image
6070
uses: docker/build-push-action@v3
6171
with:
6272
context: "."
6373
file: "./Dockerfile"
64-
push: false
65-
load: true
74+
push: true
75+
load: false
6676
tags: ${{ steps.meta.outputs.tags }}
6777
labels: ${{ steps.meta.outputs.labels }}
6878
platforms: linux/amd64
@@ -118,8 +128,8 @@ jobs:
118128
- uses: actions/checkout@v3
119129
- uses: erlef/setup-beam@v1
120130
with:
121-
elixir-version: '1.11.4' # Define the elixir version [required]
122-
otp-version: '23.3' # Define the OTP version [required]
131+
version-file: .tool-versions
132+
version-type: strict
123133
- uses: azure/setup-helm@v3
124134
with:
125135
version: latest
@@ -134,14 +144,14 @@ jobs:
134144
uses: actions/cache@v3
135145
with:
136146
path: deps
137-
key: ${{ runner.os }}-mix-5-${{ hashFiles('**/mix.lock') }}
138-
restore-keys: ${{ runner.os }}-mix-5
147+
key: ${{ runner.os }}-mix-6-${{ hashFiles('**/mix.lock') }}
148+
restore-keys: ${{ runner.os }}-mix-6
139149
- name: Restore _build
140150
uses: actions/cache@v3
141151
with:
142152
path: _build
143-
key: ${{ runner.os }}-mix-5-${{ hashFiles('**/mix.lock') }}
144-
restore-keys: ${{ runner.os }}-mix-5
153+
key: ${{ runner.os }}-mix-6-${{ hashFiles('**/mix.lock') }}
154+
restore-keys: ${{ runner.os }}-mix-6
145155
- run: mix deps.get
146156
- run: mix test
147157
- uses: 8398a7/action-slack@v3

.github/workflows/www.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
build:
1818
name: Build image
1919
runs-on: ubuntu-20.04
20+
permissions:
21+
contents: 'read'
22+
id-token: 'write'
23+
packages: 'write'
2024
steps:
2125
- uses: actions/checkout@v3
2226
- name: Docker meta
@@ -26,19 +30,27 @@ jobs:
2630
# list of Docker images to use as base name for tags
2731
images: |
2832
ghcr.io/pluralsh/plural-www
29-
dkr.plural.sh/plural/plural-www
30-
gcr.io/pluralsh/plural-www
3133
# generate Docker tags based on the following events/attributes
3234
tags: |
3335
type=sha
34-
- uses: docker/setup-qemu-action@v2
35-
- uses: docker/setup-buildx-action@v2
36+
type=ref,event=pr
37+
type=ref,event=branch
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v2
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v2
42+
- name: Login to GHCR
43+
uses: docker/login-action@v2
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.repository_owner }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
3648
- uses: docker/build-push-action@v3
3749
with:
3850
context: ./www
3951
file: ./www/Dockerfile
40-
push: false
41-
load: true
52+
push: true
53+
load: false
4254
tags: ${{ steps.meta.outputs.tags }}
4355
labels: ${{ steps.meta.outputs.labels }}
4456
platforms: linux/amd64

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
erlang 23.3
2-
elixir 1.11.0
1+
erlang 24.3.4.6
2+
elixir 1.12.3

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM bitwalker/alpine-elixir:1.11.4 AS builder
1+
FROM bitwalker/alpine-elixir:1.12.3 AS builder
22

33
# The following are build arguments used to change variable parts of the image.
44
# The name of your application/release (required)
@@ -89,7 +89,7 @@ RUN apk add --update --no-cache curl ca-certificates unzip wget openssl && \
8989
chmod +x /usr/local/bin/terrascan && \
9090
chmod +x /usr/local/bin/trivy
9191

92-
FROM erlang:23.3.4.18-alpine
92+
FROM erlang:24.3.4.6-alpine
9393

9494
# The name of your application/release (required)
9595
ARG APP_NAME

apps/api/lib/api.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule Api do
88
"""
99

1010
def hmac(secret, payload) do
11-
:crypto.hmac(:sha256, secret, payload)
11+
:crypto.mac(:hmac, :sha256, secret, payload)
1212
|> Base.encode16(case: :lower)
1313
end
1414

apps/core/lib/core/services/accounts.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ defmodule Core.Services.Accounts do
466466
end
467467

468468
def hmac(secret, payload) when is_binary(payload) do
469-
:crypto.hmac(:sha, secret, payload)
469+
:crypto.mac(:hmac, :sha, secret, payload)
470470
|> Base.encode16(case: :lower)
471471
end
472472

apps/core/lib/core/services/shell/scm.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ defmodule Core.Shell.Scm do
1111
"""
1212
@spec keypair(binary) :: {:ok, binary, binary} | error
1313
def keypair(email) do
14-
with {_, _, _, params, public} = private <- :public_key.generate_key({:namedCurve, :secp256r1}),
14+
with {_, _, _, params, public, _} = private <- :public_key.generate_key({:namedCurve, :secp256r1}),
1515
entry <- :public_key.pem_entry_encode(:ECPrivateKey, private),
1616
pem_private <- :public_key.pem_encode([entry]),
17-
ssh_public <- :public_key.ssh_encode([{{{:ECPoint, public}, params}, [{:comment, email}]}], :openssh_public_key),
17+
ssh_public <- :ssh_file.encode([{{{:ECPoint, public}, params}, [{:comment, email}]}], :openssh_key),
1818
do: {:ok, pem_private, ssh_public}
1919
end
2020

apps/core/lib/core/services/users.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ defmodule Core.Services.Users do
602602
defp sanitize(url), do: "https://" <> url
603603

604604
def hmac(secret, payload) when is_binary(payload) do
605-
:crypto.hmac(:sha, secret, payload)
605+
:crypto.mac(:hmac, :sha, secret, payload)
606606
|> Base.encode16(case: :lower)
607607
end
608608

apps/core/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ defmodule Core.MixProject do
6969
{:ex_machina, "~> 2.7.0", only: :test},
7070
{:comeonin, "~> 5.3.0"},
7171
{:argon2_elixir, "~> 2.0"},
72-
{:piazza_core, "~> 0.3.8"},
72+
{:piazza_core, "~> 0.3.8", git: "https://github.com/michaeljguarino/piazza_core"},
7373
{:inet_cidr, "~> 1.0.0"},
7474
{:dns, "~> 2.4.0"},
7575
{:bamboo, "~> 2.0"},

0 commit comments

Comments
 (0)