Skip to content

Commit

Permalink
feat: test publich to hex
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatist-ban committed Feb 26, 2024
1 parent 915d65b commit 4a5243f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 37 deletions.
61 changes: 26 additions & 35 deletions .github/workflows/template-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_2 }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
NG_CLI_ANALYTICS: "ci"
GITHUB_API_URL: "https://api.github.com"
PUBLISH_ARTIFACT: true
Expand All @@ -28,43 +29,42 @@ jobs:

- uses: actions/checkout@v4

# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# java-version: '17'
# distribution: 'adopt'
# cache: maven
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: maven

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x

# - name: SetUp Angular CLI
# run: npm install -g @angular/cli
- name: SetUp Angular CLI
run: npm install -g @angular/cli

- name: Set up Elixir 1.14.3 and Otp 25
uses: erlef/setup-beam@v1
with:
elixir-version: '1.14.3'
otp-version: '25'


# - name: Build with Maven
# run: mvn -B package -DskipTests --file SpringBoot/Konex/pom.xml
- name: Build with Maven
run: mvn -B package -DskipTests --file SpringBoot/Konex/pom.xml

# - name: Build with Angular
# run: |
# npm run ng analytics off --prefix Angular/Konex/
# npm install --prefix Angular/Konex/
# npm run build --prefix Angular/Konex/
- name: Build with Angular
run: |
npm run ng analytics off --prefix Angular/Konex/
npm install --prefix Angular/Konex/
npm run build --prefix Angular/Konex/
# - name: Install zip package
# uses: montudor/action-zip@v1
- name: Install zip package
uses: montudor/action-zip@v1

# - name: Zip Angular dist
# run: zip -qq -r dist.zip konex-app
# working-directory: Angular/Konex/dist
- name: Zip Angular dist
run: zip -qq -r dist.zip konex-app
working-directory: Angular/Konex/dist

- name: setup semantic-release
run: npm install -g semantic-release @semantic-release/exec @semantic-release/changelog @semantic-release/github -D
Expand All @@ -85,15 +85,6 @@ jobs:
key: ${{ runner.os }}-mix-${{ hashFiles('**/Elixir/Konex/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Show files
run: |
ls
echo "------------------------------"
ls Elixir/Konex/
echo "------------------------------"
ls Elixir/Konex/deps
echo "------------------------------"
- name: Install Mix dependencies
run: mix deps.get
working-directory: Elixir/Konex
Expand All @@ -119,8 +110,8 @@ jobs:
# name: Release Bot
# email: [email protected]

# - name: Publish to HEX
# if: ${{ env.PUBLISH_ARTIFACT }} == true
# run: mix hex.publish --replace --yes
# env:
# HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
- name: Publish to HEX
if: ${{ env.PUBLISH_ARTIFACT }} == true
run: mix hex.publish --replace --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
20 changes: 18 additions & 2 deletions Elixir/Konex/mix.exs
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
defmodule ReactiveCommons.MixProject do
use Mix.Project

@version "0.0.1"
@version "1.0.0"

def project do
[
app: :Hello_world_app,
version: @version,
deps: deps(),
description: description(),
]
end

defp hello(_) do
Mix.shell().info("Hello world")
end

defp description() do
"Domain driven async abstractions like Domain Event Bus, Event subscriptions/emit, Async Command handling and Async Req/Reply."
end

# Run "mix help deps" to learn about dependencies.
defp deps do
[
Expand All @@ -25,7 +30,18 @@ defmodule ReactiveCommons.MixProject do
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:telemetry, "~> 1.2"},
{:mock, "~> 0.3", only: :test}
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
# {:dep_from_git, git: "https://github.com/braybatista/Konex.git", tag: "1.0.0"}
]
end

defp package() do
[
# This option is only needed when you don't want to use the OTP application name
name: "Konex",
files: ["test", "mix.exs", "formatter.exs", "mix.lock"],
maintainers: ["Brayan Batista Zuniga"],
licenses: ["Apache-2.0"],
links: %{"GitHub" => "https://github.com/braybatista/Konex"}
]
end
end

0 comments on commit 4a5243f

Please sign in to comment.