Skip to content

Commit 458684d

Browse files
authored
feat: Hex workflow
1 parent 721aee5 commit 458684d

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed
Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: Publish VS Code extension
1+
name: Publish Refactorex
22

33
on:
44
push:
55
tags:
66
- '**'
77

88
jobs:
9-
publish:
10-
name: Publish
9+
vscode:
10+
name: Publish VS Code extension
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
@@ -38,4 +38,33 @@ jobs:
3838
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
3939
registryUrl: https://marketplace.visualstudio.com
4040
baseContentUrl: https://github.com/gp-pereira/refactorex/blob/main/
41-
baseImagesUrl: https://github.com/gp-pereira/refactorex/blob/main/
41+
baseImagesUrl: https://github.com/gp-pereira/refactorex/blob/main/
42+
43+
hex:
44+
name: Publish Hex package
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v2
49+
50+
- name: Setup Elixir
51+
uses: erlef/setup-beam@v1
52+
with:
53+
elixir-version: 1.13
54+
otp-version: 24
55+
56+
- name: Install Hex
57+
run: mix local.hex --force
58+
59+
- name: Update version in mix.exs
60+
run: |
61+
sed -i 's/version: "[^"]*"/version: "${{ github.ref_name }}"/' refactorex/mix.exs
62+
63+
- name: Publish to Hex
64+
env:
65+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
66+
run: |
67+
cd refactorex
68+
mix do deps.get, compile
69+
mix hex.publish package --yes
70+

refactorex/mix.exs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ defmodule Refactorex.MixProject do
88
elixir: "~> 1.13",
99
start_permanent: Mix.env() == :prod,
1010
elixirc_paths: elixirc_paths(Mix.env()),
11+
description: description(),
12+
package: package(),
1113
deps: deps()
1214
]
1315
end
1416

17+
defp description(), do: "Elixir source code refactoring"
18+
1519
def application do
1620
[
1721
extra_applications: [:logger],
@@ -23,4 +27,12 @@ defmodule Refactorex.MixProject do
2327
defp elixirc_paths(_), do: ["lib"]
2428

2529
defp deps, do: [{:sourceror, "~> 1.7"}]
30+
31+
defp package() do
32+
[
33+
files: ~w(lib),
34+
licenses: ["MIT"],
35+
links: %{"GitHub" => "https://github.com/gp-pereira/refactorex"}
36+
]
37+
end
2638
end

0 commit comments

Comments
 (0)