Notifications bugfix #16
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: Version checks | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- synchronize | |
jobs: | |
check-files-changed: | |
name: Check files have changed that would require a version bump. | |
runs-on: ubuntu-latest | |
outputs: | |
should-verify: ${{ contains(steps.changed-files.outputs.changed_files, 'lib/') }} | |
steps: | |
- id: changed-files | |
uses: knu/changed-files@v1 | |
with: | |
paths: | | |
'**/lib' | |
- name: show changed files | |
run: | | |
echo "Changed files:" | |
echo "${{ steps.changed-files.outputs.changed_files }}" | |
echo "Matched files:" | |
echo "${{ steps.changed-files.outputs.matched_files }}" | |
echo "Should verify:" | |
echo "${{ contains(steps.changed-files.outputs.changed_files, 'lib/') }} " | |
verify-version: | |
name: Verify pubspec version has been bumped & release notes updated. | |
runs-on: ubuntu-latest | |
needs: check-files-changed | |
if: ${{ needs.check-files-changed.outputs.should-verify == 'true'}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: "Ensure pubspec and release notes have been updated" | |
uses: danieljimeneznz/[email protected] | |
with: | |
require-changes-to: | | |
pubspec.yaml | |
CHANGELOG.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Parse pubspec.yaml | |
id: yaml-version | |
uses: nichmor/[email protected] | |
with: | |
config: pubspec.yaml | |
- name: Print pubspec.yaml version | |
run: | | |
echo "${{ steps.yaml-version.outputs['version'] }}" | |
- name: Fetch previous tag | |
id: tag-version | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: 0.0.1 | |
- name: Display tag version | |
run: | | |
echo "${{ steps.tag-version.outputs.tag }}" | |
- uses: dart-lang/setup-dart@v1 | |
- name: Verify version increase | |
id: version-up | |
run: | | |
cd version_check | |
dart pub get | |
dart run bin/version_check.dart -p "${{ steps.tag-version.outputs.tag }}" -n "${{ steps.yaml-version.outputs['version'] }}" | |