-
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.
- Loading branch information
1 parent
8c46209
commit eeb00ea
Showing
1 changed file
with
15 additions
and
10 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 |
---|---|---|
|
@@ -3,19 +3,22 @@ name: Arduino Library Release | |
on: | ||
push: | ||
branches: | ||
- main # Esegui il workflow solo sul branch `main` | ||
- main # Attiva il workflow solo sul branch `main` | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# 1. Controlla che il commit message segua il pattern `vX.Y.Z` | ||
# 1. Controlla il messaggio del commit per il pattern `vX.Y.Z` | ||
- name: Check commit message | ||
id: check_message | ||
run: | | ||
echo "Commit message: ${{ github.event.head_commit.message }}" | ||
if [[ ! "${{ github.event.head_commit.message }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
if [[ "${{ github.event.head_commit.message }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Valid version: ${{ github.event.head_commit.message }}" | ||
echo "VERSION=${{ github.event.head_commit.message }}" >> $GITHUB_ENV | ||
else | ||
echo "Commit message does not match pattern vX.Y.Z. Skipping." | ||
exit 1 | ||
fi | ||
|
@@ -24,13 +27,15 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# 3. Imposta Arduino CLI (opzionale) | ||
- name: Setup Arduino CLI | ||
uses: arduino/setup-arduino-cli@v1 | ||
with: | ||
version: 0.32.2 | ||
# 3. Crea un tag basato sul commit | ||
- name: Create Git Tag | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git tag $VERSION | ||
git push origin $VERSION | ||
# 5. Crea la release su GitHub | ||
# 4. Crea una release su GitHub | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
|
@@ -39,4 +44,4 @@ jobs: | |
library.properties | ||
examples/** | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |