Skip to content

Commit 5cdf531

Browse files
committed
Adjust calculation of project version
It appears Git tags are not available during CI runs. Let's try a different approach by having the CI write a 'VERSION' file and having the Mix project read that if available.
1 parent 1b0015f commit 5cdf531

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18+
- name: Write VERSION file
19+
run: echo $REF_NAME > VERSION
20+
env:
21+
REF_NAME: ${{ github.ref_name }}
22+
1823
- name: Set up Elixir
1924
uses: erlef/setup-beam@v1
2025
with:

mix.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ defmodule PgLargeObjects.MixProject do
6666
defp dialyzer(_env), do: []
6767

6868
defp version do
69-
case System.cmd("git", ["describe", "--tags"]) do
70-
{output, 0} -> String.trim(output)
71-
_ -> nil
69+
case File.read("VERSION") do
70+
{:ok, output} -> String.trim(output)
71+
_ -> "0.1.0-dev"
7272
end
7373
end
7474
end

0 commit comments

Comments
 (0)