Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PR checks

on:
pull_request:
types:
- opened
- reopened
- synchronize
paths-ignore:
- .github
- .idea
- .vscode

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true


#jobs:
# run:
# if: github.event.pull_request.draft == false
# uses: rees46/workflow/.github/workflows/reusable-flutter-js-checks.yaml@master
# with:
# app-id: ${{ vars.VERSIONER_ID }}
# secrets:
# private-key: ${{ secrets.VERSIONER_SECRET }}

jobs:
check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.44.0'
channel: 'stable'

- name: Get dependencies
run: flutter pub get

- name: Analyze code
run: flutter analyze --fatal-infos --fatal-warnings

- name: Run tests
run: flutter test --coverage

- name: Check formatting
run: dart format --output=none --set-exit-if-changed .

- name: Build (verify)
run: flutter build apk --debug
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy

on:
push:
branches:
- master
workflow_dispatch:

jobs:
publish:
name: Publish to pub.dev
runs-on: ubuntu-latest

if: github.repository_owner == 'rees46'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Check version change
id: version_check
run: |
VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}')
echo "Current version: $VERSION"

if flutter pub deps | grep -q "$VERSION"; then
echo "Version $VERSION already published, skipping"
echo "should_publish=false" >> $GITHUB_OUTPUT
else
echo "should_publish=true" >> $GITHUB_OUTPUT
fi

- name: Publish to pub.dev
if: steps.version_check.outputs.should_publish == 'true'
run: |
# Создаём файл с credentials (берём из секретов)
echo "${{ secrets.PUB_DEV_CREDENTIALS }}" > ~/.pub-cache/credentials.json

# Публикуем без интерактивного подтверждения
flutter pub publish --force
env:
PUB_DEV_CREDENTIALS: ${{ secrets.PUB_DEV_CREDENTIALS }}
Loading