Skip to content

Commit 452f740

Browse files
authored
Merge pull request #132 from WTTJ/chore/fix-publish-public-package
chore: fix publish public package
2 parents 2636a1a + 4c402ac commit 452f740

File tree

2 files changed

+44
-45
lines changed

2 files changed

+44
-45
lines changed

.github/workflows/publich_public_package.yml

-45
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish package to Hex.pm
2+
3+
on:
4+
release:
5+
types: [published, released]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
if: "!github.event.release.prerelease"
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Elixir
16+
uses: erlef/setup-beam@v1
17+
with:
18+
elixir-version: '1.17.2'
19+
otp-version: '26.2.5.2'
20+
21+
- name: Install dependencies
22+
run: |
23+
mix deps.get
24+
25+
- name: Compile
26+
run: |
27+
mix compile
28+
29+
- name: Check version consistency
30+
run: |
31+
MIX_VERSION=$(mix run -e 'IO.puts Mix.Project.config[:version]')
32+
RELEASE_VERSION=${{ github.event.release.tag_name }}
33+
RELEASE_VERSION=${RELEASE_VERSION#v}
34+
35+
if [ "$MIX_VERSION" != "$RELEASE_VERSION" ]; then
36+
echo "Version mismatch: mix.exs version ($MIX_VERSION) != release version ($RELEASE_VERSION)"
37+
exit 1
38+
fi
39+
40+
- name: Publish to Hex.pm
41+
env:
42+
HEX_API_KEY: ${{ secrets.HEXPM_PUBLIC_PACKAGES_KEY }}
43+
run: |
44+
mix hex.publish --yes

0 commit comments

Comments
 (0)