Skip to content

Commit

Permalink
Merge pull request #15 from NarrativeApp/feat/leave-service-names-alone
Browse files Browse the repository at this point in the history
feat: don't convert underscores to hyphens in systemd service names
  • Loading branch information
puzza007 authored May 21, 2024
2 parents 1ccff7e + e1fb9f3 commit 79e2e79
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 50 deletions.
84 changes: 42 additions & 42 deletions .github/workflows/private-elixir-library-w-git-ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,173 +3,173 @@ on: push
name: Privately published Elixir Library (with git ops)

env:
ELIXIR_VERSION: "1.9"
OTP_VERSION: "22.2"
ELIXIR_VERSION: "1.14.5-otp-24"
OTP_VERSION: "24.3.4.17"

jobs:
deps:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
env:
NARRATIVE_HEX_ORG_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Signing into narrativeapp organisation on hex
run: mix hex.organization auth narrativeapp --key $NARRATIVE_HEX_ORG_API_KEY
- name: Downloading dependency cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-deps
- run: mix deps.get
- name: Uploading dependencies for other jobs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: deps
path: deps/

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: ["deps"]
env:
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifact cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: _build
key: ${{ runner.os }}-build
- name: Run `mix compile`
run: mix compile
- name: Uploading build artifacts for other jobs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: build
path: _build/

credo:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: ["deps", "build"]
env:
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
- run: mix credo --strict

formatter:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- run: mix format --check-formatted

audit:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: ["deps"]
env:
NARRATIVE_HEX_ORG_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- run: mix hex.organization auth narrativeapp --key $NARRATIVE_HEX_ORG_API_KEY
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- run: mix hex.audit

test:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: ["deps", "build"]
env:
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
- run: mix test

is_releasable:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: ["deps", "test", "audit", "formatter", "credo"]
if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/master'}}
env:
HEX_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
Expand All @@ -179,41 +179,41 @@ jobs:
- name: Run mix hex.build
run: mix hex.build -o ${{ steps.app-info.outputs.app_name }}-${{ steps.app-info.outputs.app_version }}.tar
- name: Uploading hex package as job artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.app-info.outputs.app_name }}-${{ steps.app-info.outputs.app_version }}.tar
path: ${{ steps.app-info.outputs.app_name }}-${{ steps.app-info.outputs.app_version }}.tar
- name: Run mix docs
run: MIX_ENV=test mix docs && tar zcvf docs.tar.gz doc/
- name: Uploading documentation as job artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.app-info.outputs.app_name }}-docs-${{ steps.app-info.outputs.app_version }}.tar.gz
path: docs.tar.gz

git_ops:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
needs: ["deps", "test", "audit", "formatter", "credo"]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
env:
HEX_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
Expand Down
5 changes: 1 addition & 4 deletions lib/mix/tasks/systemd.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ defmodule Mix.Tasks.Systemd do

app_name = mix_config[:app]

ext_name =
app_name
|> to_string
|> String.replace("_", "-")
ext_name = app_name

service_name = ext_name

Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"credo": {:hex, :credo, "1.5.5", "e8f422026f553bc3bebb81c8e8bf1932f498ca03339856c7fec63d3faac8424b", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dd8623ab7091956a855dc9f3062486add9c52d310dfd62748779c4315d8247de"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"credo": {:hex, :credo, "1.7.6", "b8f14011a5443f2839b04def0b252300842ce7388f3af177157c86da18dfbeea", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "146f347fb9f8cbc5f7e39e3f22f70acbef51d441baa6d10169dd604bfbc55296"},
"earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm", "000aaeff08919e95e7aea13e4af7b2b9734577b3e6a7c50ee31ee88cab6ec4fb"},
"earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"},
"ex_doc": {:hex, :ex_doc, "0.24.2", "e4c26603830c1a2286dae45f4412a4d1980e1e89dc779fcd0181ed1d5a05c8d9", [:mix], [{:earmark_parser, "~> 1.4.0", [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", "e134e1d9e821b8d9e4244687fb2ace58d479b67b282de5158333b0d57c6fb7da"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
"git_cli": {:hex, :git_cli, "0.3.0", "a5422f9b95c99483385b976f5d43f7e8233283a47cda13533d7c16131cb14df5", [:mix], [], "hexpm", "78cb952f4c86a41f4d3511f1d3ecb28edb268e3a7df278de2faa1bd4672eaf9b"},
"git_ops": {:hex, :git_ops, "2.4.2", "291a4f105dfa3d34cffa56cf8faf0e8c2699b49d3316270aa4881e75c62b1832", [:mix], [{:git_cli, "~> 0.2", [hex: :git_cli, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "bd9051c49e17d0dc2e0ae9306292f9f5f671d402227f5dda12e69a702198dec4"},
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
Expand Down

0 comments on commit 79e2e79

Please sign in to comment.