Skip to content

wip(ci): Separa testo in altra variabile #70

wip(ci): Separa testo in altra variabile

wip(ci): Separa testo in altra variabile #70

Workflow file for this run

name: Create Release
on:
workflow_dispatch:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+**"
permissions:
contents: write
jobs:
tests:
uses: ./.github/workflows/run-tests.yml
latest_changelog:
runs-on: ubuntu-latest
outputs:
changelog_slug: ${{ steps.slugify.outputs.changelog_slug }}
steps:
- name: "πŸ›’ Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install github-slugger
- name: "Find changelog entry"
id: slugify
shell: bash
run: |
set -x;
echo "Github ref: '${{ github.ref }}'";
tag_name="$(echo "${{ github.ref }}" | sed -r 's/refs\/tags\///')";
echo "Tag name: '$tag_name'";
file -i CHANGELOG.md;
changelog_text="$(cat CHANGELOG.md)";
changelog_slug="$(echo "$changelog_text" | grep -a -E "^##\s*\[\s*${tag_name//./\\.}\s*\].*" )";
echo "::debug::Changelog entry: '$changelog_slug'";
if [[ -z "$changelog_slug" ]]; then
echo "No changelog entry found for ${{ github.ref }}";
exit 1;
elif [[ "$(wc -l <<< "$changelog_slug")" -gt 1 ]]; then
echo "Multiple changelog entries found for ${{ github.ref }}";
exit 1;
fi
changelog_slug="$(node ./scripts/slugify.mjs "$changelog_slug")";
echo "Generated changelog slug: '$changelog_slug'";
echo "changelog_slug=${changelog_slug}" >> $GITHUB_OUTPUT;
release_body:
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
steps:
- name: "πŸ›’ Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "🧬 Generate Changelog"
uses: ardalanamini/auto-changelog@v3
id: changelog
with:
commit-types: |
breaking: ⚠ Breaking Changes ⚠
feat: ✨ Features ✨
✨ feat: ✨ Features ✨
fix: πŸ› Risoluzione bug πŸ›
🐞 fix: πŸ› Risoluzione bug πŸ›
perf: πŸš€ Performance πŸš€
πŸš€ perf: πŸš€ Performance πŸš€
docs: πŸ“„ Documentazione πŸ“„
πŸ“„ docs: πŸ“„ Documentazione πŸ“„
other: Altre modifiche
default-commit-type: Altre modifiche
mention-authors: false
mention-new-contributors: true
include-compare: true
semver: false
build-and-release:
runs-on: windows-latest
needs: [tests, latest_changelog, release_body] # Require dependencies to finish
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: "πŸ›’ Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "🐍 Install Python"
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'poetry'
- name: "πŸ“œ Install Poetry"
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.3.2
- name: "πŸ” Install dependencies"
run: poetry install
- name: "πŸŽ‰ Generate artifacts"
run: |
poetry run build
- name: "🏁 Create Release"
uses: ncipollo/release-action@v1
with:
allowUpdates: false
body: |
Di seguito l'elenco delle modifiche introdotte in questa versione.
[**Visualizza il changelog completo**](/CHANGELOG.md#${{ needs.latest_changelog.outputs.changelog_slug }})
${{ needs.release_body.outputs.changelog }}
# generateReleaseNotes: true
makeLatest: true
prerelease: false
artifacts: "dist/*.exe"