Skip to content

Commit 0ccaa87

Browse files
ci: improve automatic deploy
1 parent 8c7bffe commit 0ccaa87

File tree

2 files changed

+26
-65
lines changed

2 files changed

+26
-65
lines changed

.github/workflows/base.yaml

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main]
66
tags:
7-
- '*'
7+
- "[0-9]+.[0-9]+.[0-9]+*"
88

99
pull_request:
1010
branches: [main]
@@ -14,10 +14,6 @@ on:
1414
jobs:
1515
build:
1616
runs-on: macos-latest
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
channel: [stable]
2117

2218
steps:
2319
- uses: actions/checkout@v3
@@ -30,7 +26,7 @@ jobs:
3026
- name: Flutter action
3127
uses: subosito/flutter-action@v2
3228
with:
33-
channel: ${{ matrix.channel }}
29+
channel: "stable"
3430

3531
- name: Install dependencies
3632
run: flutter pub get
@@ -40,6 +36,11 @@ jobs:
4036
run: flutter analyze
4137
- name: Run tests
4238
run: flutter test --coverage
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v3
41+
with:
42+
files: coverage/lcov.info
43+
name: form_builder_extra_fields
4344
- name: Check publish warnings
4445
run: dart pub publish --dry-run
4546
- name: Build example
@@ -49,42 +50,28 @@ jobs:
4950
flutter build ios --debug --no-codesign
5051
flutter build web
5152
52-
- name: Upload coverage to Codecov
53-
if: ${{ matrix.channel == 'stable' }}
54-
uses: codecov/codecov-action@v3
55-
with:
56-
files: coverage/lcov.info
57-
flags: unittests
58-
name: form_builder_extra_fields
59-
6053
deployment:
6154
if: ${{ github.ref_type == 'tag' }}
6255
needs: build
6356
name: Deploy package
57+
permissions:
58+
id-token: write
6459
runs-on: ubuntu-latest
65-
6660
steps:
67-
- name: Configure enviroment
68-
uses: actions/checkout@v3
69-
- name: Download flutter
70-
uses: subosito/flutter-action@v2
71-
with:
72-
channel: 'stable'
73-
- name: Setup pub credentials
74-
shell: bash
75-
env:
76-
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
77-
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
78-
run: |
79-
sh ./tool/pub_login.sh
80-
- name: Publish package
81-
run: dart pub publish -v -f
82-
- name: Build changelog
83-
id: github_release
84-
uses: mikepenz/release-changelog-builder-action@v3
85-
env:
86-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
- name: Create release
88-
uses: softprops/[email protected]
89-
with:
90-
body: ${{steps.github_release.outputs.changelog}}
61+
- uses: actions/checkout@v3
62+
- uses: dart-lang/setup-dart@v1
63+
- name: Flutter action
64+
uses: subosito/flutter-action@v2
65+
with:
66+
channel: "stable"
67+
- name: Publish package
68+
run: dart pub publish -v -f
69+
- name: Build changelog
70+
id: github_release
71+
uses: mikepenz/release-changelog-builder-action@v3
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
- name: Create release
75+
uses: softprops/action-gh-release@v1
76+
with:
77+
body: ${{steps.github_release.outputs.changelog}}

tool/pub_login.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)