Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton committed Sep 11, 2023
0 parents commit 885fa19
Show file tree
Hide file tree
Showing 398 changed files with 52,258 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: "Merge"

on:
push:
# pull_request:
# types: [closed]

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@{latest-release}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.merged
steps:
- uses: actions/checkout@v3
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:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.files == 'true'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup Dart SDK
uses: dart-lang/[email protected]
- name: install cider
run: dart pub global activate cider
- name: Change flutter version tag
run: |
echo "FLUTTER_BUILD_VERSION=$(cider bump patch --bump-build)" >> "$GITHUB_ENV"
- name: Update
id: update
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add -A
git commit --amend --no-edit
git push -f
echo "newSha=$(git rev-parse ${{github.event.pull_request.head.sha}})" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{env.FLUTTER_BUILD_VERSION}}',
sha: "${{env.newSha}}"
})
- name: release
uses: actions/github-script@v5
if: ${{ (steps.bump.outputs.release == 'true') && (env.modified == 'true') }}
with:
script: |
github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: "${{steps.bump.outputs.version}}",
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: "${{steps.bump.outputs.version}}",
});
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@{latest-release}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 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
# - name: Deploy
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# folder: build
68 changes: 68 additions & 0 deletions .github/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "PR"

on:
pull_request:

jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
files: ${{steps.changed-files.outputs.any_changed}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Check branch is up to date
run: |
if git merge-base --is-ancestor ${{ github.event.pull_request.base.sha}} ${{ github.event.pull_request.head.sha}}
then
echo "Your branch is up to date."
exit 0
else
echo "You need to merge / rebase."
exit 1
fi
- 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
analyze:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.files == 'true'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
- name: Lint and format
run: |
dart format . -l 120
dart fix --apply
flutter analyze
- name: Check for modified files
id: git-check
run: echo "modified=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)" >> $GITHUB_ENV
- name: Update changes in GitHub repository
if: env.modified == 'true'
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add -A
git commit -m '[automated commit] lint format and import sort'
git push
95 changes: 95 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: "Merge"

on:
pull_request:
types: [closed]

jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event.pull_request.merged
steps:
- uses: actions/checkout@v3
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:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.files == 'true'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Setup Dart SDK
uses: dart-lang/[email protected]
- name: install cider
run: dart pub global activate cider
- name: Change flutter version tag
run: |
echo "FLUTTER_BUILD_VERSION=$(cider bump patch --bump-build)" >> "$GITHUB_ENV"
- name: Update
id: update
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add -A
git commit --amend --no-edit
git push -f
echo "newSha=$(git rev-parse ${{github.event.pull_request.head.sha}})" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{env.FLUTTER_BUILD_VERSION}}',
sha: "${{env.newSha}}"
})
- name: release
uses: actions/github-script@v5
if: ${{ (steps.bump.outputs.release == 'true') && (env.modified == 'true') }}
with:
script: |
github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: "${{steps.bump.outputs.version}}",
owner: context.repo.owner,
prerelease: false,
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
# TODO(thelukewalton): check this works
run: |
cd example
flutter build web -o ../build --no-tree-shake-icons
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
68 changes: 68 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "PR"

on:
pull_request:

jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
files: ${{steps.changed-files.outputs.any_changed}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Check branch is up to date
run: |
if git merge-base --is-ancestor ${{ github.event.pull_request.base.sha}} ${{ github.event.pull_request.head.sha}}
then
echo "Your branch is up to date."
exit 0
else
echo "You need to merge / rebase."
exit 1
fi
- 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
analyze:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.files == 'true'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
- name: Lint and format
run: |
dart format . -l 120
dart fix --apply
dart analyze
- name: Check for modified files
id: git-check
run: echo "modified=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)" >> $GITHUB_ENV
- name: Update changes in GitHub repository
if: env.modified == 'true'
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add -A
git commit -m '[automated commit] lint format and import sort'
git push
Loading

0 comments on commit 885fa19

Please sign in to comment.