Skip to content

Commit 4b35a16

Browse files
committed
refactor: using version file to updated package number
Signed-off-by: alt-ctrl-dev <1557519+alt-ctrl-dev@users.noreply.github.com>
1 parent 31adc92 commit 4b35a16

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v3
2121

22+
- name: Add release version to VERSION.txt
23+
run: echo ${{ github.ref_name }} > VERSION.txt
24+
2225
- name: Set up Elixir
2326
uses: erlef/setup-beam@v1
2427
with:
2528
elixir-version: 1.0
2629
otp-version: 24.2
2730

28-
- name: Run tests
31+
- name: Publish package
2932
run: mix hex.publish --yes

VERSION.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.0

mix.exs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule AbaValidator.MixProject do
66
def project do
77
[
88
app: :aba_validator,
9-
version: "1.0.0",
9+
version: "VERSION.txt" |> File.read!() |> String.trim() || "0.0.0",
1010
elixir: "~> 1.14",
1111
build_embedded: Mix.env == :prod,
1212
start_permanent: Mix.env == :prod,
@@ -45,8 +45,7 @@ defmodule AbaValidator.MixProject do
4545
# This option is only needed when you don't want to use the OTP application name
4646
name: "aba_validator",
4747
# These are the default files included in the package
48-
files: ~w(lib priv .formatter.exs mix.exs README* readme* LICENSE*
49-
license* CHANGELOG* changelog* src),
48+
files: ~w(lib .formatter.exs mix.exs README* LICENSE*),
5049
licenses: ["Apache-2.0"],
5150
links: %{"GitHub" => @github_link}
5251
]

0 commit comments

Comments
 (0)