-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add release workflow for automatic version bump and asset upload
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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) | ||
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 | ||
- name: Commit and push version update | ||
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 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: | ||
files: queen_of_hearts.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |