Skip to content

Bump reqwest from 0.12.23 to 0.12.24 (#163) #9

Bump reqwest from 0.12.23 to 0.12.24 (#163)

Bump reqwest from 0.12.23 to 0.12.24 (#163) #9

Workflow file for this run

name: Release on version commit
on:
push:
branches:
- main
- master
jobs:
release:
runs-on: ubuntu-latest
if: |
contains(github.event.head_commit.message, 'Prepare version to')
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Extract version from commit message
id: vars
run: |
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Get previous version from git tag
id: prev_tag
run: |
TAG=$(git tag --sort=-creatordate | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n1 | sed 's/^v//')
echo "prev=${TAG}" >> $GITHUB_OUTPUT
- name: Generate Release Notes from CHANGELOG.md
id: notes
shell: bash
run: |
set -euo pipefail
VERSION="${{ steps.vars.outputs.version }}"
PREV="${{ steps.prev_tag.outputs.prev }}"
# Extrai apenas as linhas que começam com "- " da seção da versão desejada
awk "/^## Version $VERSION\$/ {flag=1; next} /^## Version / {flag=0} flag" CHANGELOG.md | grep '^- ' > changes.txt || true
echo '## What'\''s changed' > RELEASE_NOTES.md
cat changes.txt >> RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "Full Changelog: [${PREV}...${VERSION}](https://github.com/${{ github.repository }}/compare/${PREV}...v${VERSION})" >> RELEASE_NOTES.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.vars.outputs.version }}
name: v${{ steps.vars.outputs.version }}
body_path: RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: CratesIO login
run: cargo login ${{ secrets.CRATESIO_TOKEN }}
- name: CratesIO publish
run: cargo publish