Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carminelau committed Jan 8, 2025
1 parent 8c46209 commit eeb00ea
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -39,4 +44,4 @@ jobs:
library.properties
examples/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit eeb00ea

Please sign in to comment.