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 6862ac0
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 65 deletions.
94 changes: 33 additions & 61 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
name: "Merge"

on:
push:
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.all_changed_files_count }}
# 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
bump_and_tag:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.files == 'true'
if: needs.changes.outputs.any_changed != '0'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
Expand All @@ -38,15 +37,7 @@ jobs:
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 CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ secrets.PAT }}
tag: ${{ steps.read-version.outputs.version-number }}
excludeTypes: ""
includeInvalidCommits: true
echo "FLUTTER_BUILD_VERSION=$(cider bump patch)" >> "$GITHUB_ENV"
- name: Update
id: update
run: |
Expand All @@ -55,48 +46,29 @@ jobs:
git add -A
git commit --amend --no-edit
git push -f
echo "newSha=$(git rev-parse ${{github.event.pull_request.head.sha}})" >> $GITHUB_ENV
echo "newSha=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v6
id: tag
uses: mathieudutour/[email protected]
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
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{env.FLUTTER_BUILD_VERSION}}
tag_prefix: ""
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
flutter-version: "3.13.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
- name: build
token: ${{ github.token }}
tag: ${{env.FLUTTER_BUILD_VERSION}}
excludeTypes: ""
includeInvalidCommits: true
- name: Push changelog
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
git add .
git commit --amend --no-edit
git push -f
- name: Release
uses: softprops/action-gh-release@v1
with:
folder: build
body: "https://pub.dev/packages/zds_flutter/versions/${{env.FLUTTER_BUILD_VERSION}}"
tag_name: ${{env.FLUTTER_BUILD_VERSION}}
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:
# - "**"±TODO:

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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.0.1] - 2024-01-03
### :flying_saucer: Other Changes
- [`e8628a1`](https://github.com/ZebraDevs/zds_flutter/commit/e8628a1a8cf76ada08a64a0312c1f7efd23c6cd5) - actions *(commit by [@thelukewalton](https://github.com/thelukewalton))*


## [1.0.0] - 2024-01-02

### :sparkles: New features
Expand All @@ -9,3 +14,5 @@
### :sparkles: New Features

- [`885fa19`](https://github.com/zebradevs/zds-flutter/commit/885fa19d4d0ec4426a259b61cb828b6c9fac175e) - init. _(commit by [@thelukewalton](https://github.com/thelukewalton))_

[1.0.1]: https://github.com/ZebraDevs/zds_flutter/compare/v1.0.2...1.0.1
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';
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: zds_flutter
description: Zebra Design System components for Flutter. A selection of UI components from Zebra Technologies.
version: 1.0.0
version: 1.0.1
homepage: https://github.com/zebradevs/zds_flutter
repository: https://github.com/zebradevs/zds_flutter
issue_tracker: https://github.com/zebradevs/zds_flutter/issues
Expand Down

0 comments on commit 6862ac0

Please sign in to comment.