Skip to content

Commit

Permalink
actions
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton committed Jan 3, 2024
1 parent d736ecd commit c7d2952
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 43 deletions.
64 changes: 24 additions & 40 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
name: "Merge"

on:
push:
# TODO: Remove
pull_request:
types: [closed]
branches:
- main

jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.merged
outputs:
any_changed: ${{ steps.changed-files.outputs.any_changed }}
# if: github.event.pull_request.mergedTODO:
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get all changed *.dart, files in docs or pubspec.yaml
id: changed-files
uses: tj-actions/changed-files@v37
with:
base_sha: ${{ github.event.pull_request.base.sha }}
sha: ${{ github.event.pull_request.head.sha }}
files: |
**/*.dart
pubspec.yaml
merge:
uses: tj-actions/changed-files@v41
- name: test
run: |
echo ${{steps.changed-files.outputs.any_changed}}
bump_and_tag:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.files == 'true'
if: needs.changes.outputs.any_changed == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
Expand All @@ -39,14 +42,6 @@ jobs:
- name: Change flutter version tag
run: |
echo "FLUTTER_BUILD_VERSION=$(cider bump patch --bump-build)" >> "$GITHUB_ENV"
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ secrets.PAT }}
tag: ${{ steps.read-version.outputs.version-number }}
excludeTypes: ""
includeInvalidCommits: true
- name: Update
id: update
run: |
Expand All @@ -66,6 +61,15 @@ jobs:
ref: 'refs/tags/${{env.FLUTTER_BUILD_VERSION}}',
sha: "${{env.newSha}}"
})
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:—
token: ${{ github.token }}
tag: ${{env.FLUTTER_BUILD_VERSION}}
excludeTypes: ""
includeInvalidCommits: true
- name: release
uses: actions/github-script@v5
if: ${{ (steps.bump.outputs.release == 'true') && (env.modified == 'true') }}
Expand All @@ -80,23 +84,3 @@ jobs:
repo: context.repo.repo,
tag_name: "${{steps.bump.outputs.version}}",
});
build_and_deploy:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
needs: merge
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
- name: build
run: |
cd example
flutter build web -o ../build --no-tree-shake-icons --base-href "/zds_flutter/"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
outputs:
files: ${{steps.changed-files.outputs.any_changed}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
needs: changes
if: needs.changes.outputs.files == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Release"

on:
push:
tags:
- "**"

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.16.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
- name: build
run: |
cd example
flutter build web -o ../build --no-tree-shake-icons --base-href "/zds_flutter/"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
- name: Publish
run: |
dart format .
dart fix --apply
dart pub publish
2 changes: 1 addition & 1 deletion lib/zds_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export 'src/utils/localizations.dart';
export 'src/utils/theme.dart';
export 'src/utils/tools.dart';

/// Name of package
/// Name of package ttttttttt
const String packageName = 'zds_flutter';

0 comments on commit c7d2952

Please sign in to comment.