Skip to content

Commit

Permalink
Merge pull request #6 from marco-souza/enh/tag-release
Browse files Browse the repository at this point in the history
fea: setup tag-release workflow
  • Loading branch information
marco-souza authored Sep 30, 2024
2 parents 603b2bb + 9919912 commit 534e19f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/quality-gateway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Quality Gateway

on:
push:

jobs:
quality-gateway:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: install dependencies
run: sudo apt update && sudo apt install -y neovim

- name: Run tests
run: make tests
19 changes: 19 additions & 0 deletions .github/workflows/tag-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/bash
version=$(cat plugin.json | jq -r '.version')
echo Package version is $version

tag_version=$(git tag -l | grep $version)
echo Repo tag found: $tag_version

# exit if tag already exists
if [ -n "$tag_version" ]; then
echo "Tag $version already exists"
exit 0
fi

echo "Creating tag $version"
git tag $version && git push --tags

echo "Creating release $version"
gh release create -t $version --generate-notes --latest $version

21 changes: 21 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Tag release

on:
push:
paths:
- plugin.json
- .github/workflows/tag-release.yml
- .github/workflows/tag-release.sh

jobs:
gh-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create release with tag
run: sh .github/workflows/tag-release.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions lua/shared/tests.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
local M = {}

local log = require("shared.logger").create_logger({ log_level = "debug" })
-- setup resolution path
package.path = package.path .. ";./lua/?.lua"

--- Run a test
---@param name string
---@param cb function
function M.run(name, cb)
log.debug("Running test: " .. name)
print(string.format("Running test: %s", name))
cb()
log.debug("Test passed: " .. name)
print(string.format("Test passed: %s", name))
end

---Check if a file is a test file
Expand Down
5 changes: 5 additions & 0 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "marco-souza/ollero.nvim",
"description": "A plugin to open an input box for chating with Ollama",
"version": "0.1.6"
}

0 comments on commit 534e19f

Please sign in to comment.