Skip to content

Commit ec2dcd8

Browse files
committed
chore: release workflow
1 parent 126fd06 commit ec2dcd8

File tree

4 files changed

+84
-1
lines changed

4 files changed

+84
-1
lines changed

.github/workflows/release.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release:
13+
name: release
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
otp: [26.1.1]
18+
elixir: [1.15.7]
19+
steps:
20+
- uses: google-github-actions/release-please-action@v3
21+
id: release
22+
with:
23+
release-type: elixir
24+
package-name: web_dev_utils
25+
bump-minor-pre-major: true
26+
extra-files: |
27+
README.md
28+
29+
- uses: actions/checkout@v3
30+
if: ${{ steps.release.outputs.release_created }}
31+
32+
- uses: erlef/setup-beam@v1
33+
with:
34+
otp-version: ${{matrix.otp}}
35+
elixir-version: ${{matrix.elixir}}
36+
if: ${{ steps.release.outputs.release_created }}
37+
38+
- uses: actions/cache@v3
39+
id: cache
40+
if: ${{ steps.release.outputs.release_created }}
41+
with:
42+
path: |
43+
deps
44+
_build
45+
key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-
48+
49+
- name: Install Dependencies
50+
if: steps.release.outputs.release_created && steps.cache.outputs.cache-hit != 'true'
51+
run: mix deps.get
52+
53+
- name: publish to hex
54+
if: ${{ steps.release.outputs.release_created }}
55+
env:
56+
HEX_API_KEY: ${{secrets.HEX_API_KEY}}
57+
run: |
58+
mix hex.publish --yes

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ TODO
1717
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
1818
by adding `web_dev_utils` to your list of dependencies in `mix.exs`:
1919

20+
<!-- x-release-please-start-version -->
21+
2022
```elixir
2123
def deps do
2224
[
2325
{:web_dev_utils, "~> 0.1.0"}
2426
]
2527
end
2628
```
29+
<!-- x-release-please-end -->
2730

2831
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
2932
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can

mix.exs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
defmodule WebDevUtils.MixProject do
22
use Mix.Project
33

4+
@source_url "https://github.com/elixir-tools/web_dev_utils"
5+
46
def project do
57
[
68
app: :web_dev_utils,
79
version: "0.1.0",
810
elixir: "~> 1.14",
911
start_permanent: Mix.env() == :prod,
12+
package: package(),
1013
deps: deps()
1114
]
1215
end
@@ -21,10 +24,23 @@ defmodule WebDevUtils.MixProject do
2124
# Run "mix help deps" to learn about dependencies.
2225
defp deps do
2326
[
24-
{:file_system, "~> 0.2"}
27+
{:file_system, "~> 0.2"},
28+
{:ex_doc, ">= 0.0.0", only: :dev}
2529

2630
# {:dep_from_hexpm, "~> 0.3.0"},
2731
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
2832
]
2933
end
34+
35+
defp package() do
36+
[
37+
maintainers: ["Mitchell Hanberg"],
38+
licenses: ["MIT"],
39+
links: %{
40+
GitHub: @source_url,
41+
Sponsor: "https://github.com/sponsors/mhanberg"
42+
},
43+
files: ~w(lib LICENSE mix.exs README.md .formatter.exs)
44+
]
45+
end
3046
end

mix.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
%{
2+
"earmark_parser": {:hex, :earmark_parser, "1.4.37", "2ad73550e27c8946648b06905a57e4d454e4d7229c2dafa72a0348c99d8be5f7", [:mix], [], "hexpm", "6b19783f2802f039806f375610faa22da130b8edc21209d0bff47918bb48360e"},
3+
"ex_doc": {:hex, :ex_doc, "0.30.9", "d691453495c47434c0f2052b08dd91cc32bc4e1a218f86884563448ee2502dd2", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "d7aaaf21e95dc5cddabf89063327e96867d00013963eadf2c6ad135506a8bc10"},
24
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
5+
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
6+
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
7+
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
8+
"nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"},
39
}

0 commit comments

Comments
 (0)