wip(ci): Separa testo in altra variabile #70
Workflow file for this run
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
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" |