Skip to content

refactor: Update readme #42

refactor: Update readme

refactor: Update readme #42

Workflow file for this run

##.title
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##
## 🇽🇾🇿 & Dev
##
## Copyright Ⓒ Robert Mollentze
##
## Licencing details are in the LICENSE file in the root directory.
##
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
##.title~
name: Prepare for release
## -----------------------------------------------------------------------------
on:
push:
branches:
- main
## -----------------------------------------------------------------------------
jobs:
update-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Dart
uses: dart-lang/setup-dart@v1.2
- name: Format Dart code
run: dart format .
- name: Apply Dart fixes
run: dart fix --apply
- name: Extract version from pubspec.yaml
id: get_version
run: |
VERSION=$(grep "version:" pubspec.yaml | sed 's/version: //')
echo "Extracted version: $VERSION"
echo "::set-output name=extracted_version::$VERSION"
- name: Get commit messages
id: get_commits
run: |
COMMIT_MESSAGES=$(git log --format=%B -n 1 HEAD)
echo "::set-output name=messages::${COMMIT_MESSAGES}"
- name: Update CHANGELOG.md
run: |
RELEASE_NOTES="${{ steps.get_commits.outputs.messages }}"
dart run .github/scripts/update_changelog.dart "${{ steps.get_version.outputs.extracted_version }}" "$RELEASE_NOTES"
shell: bash
- name: Commit and push changes
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Prepare release for version ${{ steps.get_version.outputs.extracted_version }}"
git push