Skip to content

fix: Aggiorna l'URL del plugin nel file plugin.json #5

fix: Aggiorna l'URL del plugin nel file plugin.json

fix: Aggiorna l'URL del plugin nel file plugin.json #5

Workflow file for this run

name: Release Workflow
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Bump version (minor)
id: bump
run: |
# Estrai la versione corrente da plugin.json
VERSION=$(jq -r .version plugin.json)
# Separare la versione in major, minor, patch
IFS='.' read -r major minor patch <<< "$VERSION"
# Incrementare la versione minor
minor=$((minor + 1))
# Nuova versione
NEW_VERSION="$major.$minor.$patch"
echo "Bumping version to $NEW_VERSION"
# Salva la nuova versione in plugin.json
jq --arg version "$NEW_VERSION" '.version = $version' plugin.json > plugin.json.tmp && mv plugin.json.tmp plugin.json
echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_OUTPUT"
- name: Commit and push version update
env:
NEW_VERSION: ${{ steps.bump.outputs.NEW_VERSION }}
run: |
# Configura git
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
# Aggiungi le modifiche al file plugin.json
git add plugin.json
# Commit delle modifiche
git commit -m "Bump version to $NEW_VERSION"
# Push delle modifiche sul ramo master
git push origin master
- name: Create tag for new version
env:
NEW_VERSION: ${{ steps.bump.outputs.NEW_VERSION }}
run: |
# Crea un tag con la nuova versione
git tag "$NEW_VERSION"
# Push del tag su GitHub
git push origin "$NEW_VERSION"
- name: Create a zip of the repository
run: |
zip -r queen_of_hearts.zip .
- name: Create Release and Upload Asset
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.bump.outputs.NEW_VERSION }}
files: queen_of_hearts.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}