-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
91 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
required: true | ||
description: 'The version of the release' | ||
default: '1.0.0' | ||
git-ref: | ||
required: true | ||
description: 'The git revison of repo, branch, tag or commit' | ||
default: 'main' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Publish release to hex.pm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.git-ref }} | ||
|
||
- name: Set up Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: 27 | ||
elixir-version: 1.18 | ||
|
||
- name: Install Deps | ||
env: | ||
MIX_ENV: prod | ||
run: | | ||
mix deps.get | ||
sed -i 's%@version "[0-9\.]\+"%@version "${{ github.event.inputs.release-version }}"%' mix.exs | ||
sed -i 's%{:phoenix_react_server, "~> [0-9\.]\+"}%{:phoenix_react_server, "~> ${{ github.event.inputs.release-version }}"}%' README.md | ||
- name: Publish to hex.pm | ||
env: | ||
MIX_ENV: prod | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HEX_API_KEY: ${{ secrets.HEX_API_KEY }} | ||
run: | | ||
mix hex.publish --yes | ||
- uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: 'refs/tags/${{ github.event.inputs.release-version }}', | ||
sha: context.sha | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule Caddy.Application do | ||
@moduledoc false | ||
|
||
use Application | ||
|
||
@impl true | ||
def start(_type, args) do | ||
children = [ | ||
{Caddy, args}, | ||
] | ||
|
||
opts = [strategy: :one_for_one, name: Caddy.Application] | ||
Supervisor.start_link(children, opts) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters