Skip to content

Commit

Permalink
fea: setup tag-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-souza committed Sep 30, 2024
1 parent 603b2bb commit b6161b5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
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 dist/*

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/gh-release.yml
- .github/workflows/release-tag.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/release-tag.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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.1"
}

0 comments on commit b6161b5

Please sign in to comment.