Skip to content

Commit 6ffff4c

Browse files
authored
diffrent ci for test and release
1 parent aa410a7 commit 6ffff4c

File tree

2 files changed

+43
-22
lines changed

2 files changed

+43
-22
lines changed

.github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
if: contains(github.event.head_commit.message, 'release')
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v3
16+
with:
17+
distribution: 'zulu'
18+
java-version: '17'
19+
20+
- name: Install Flutter
21+
uses: subosito/flutter-action@v2
22+
with:
23+
channel: 'stable'
24+
25+
- name: Setup Pub Credentials
26+
shell: bash
27+
env:
28+
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
29+
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
30+
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
31+
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
32+
run: |
33+
sh ./pub_login.sh
34+
35+
- name: Check Publish Warnings
36+
run: |
37+
sudo cat /$HOME/.config/dart/pub-credentials.json
38+
flutter pub publish --dry-run
39+
40+
- name: Publish Package
41+
run: |
42+
yes | flutter pub publish

.github/workflows/publish.yml .github/workflows/run_test.yml

+1-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
name: Run Test Cases And Publish Package
2+
name: Run Test Cases
33

44
on: [pull_request]
55

@@ -37,24 +37,3 @@ jobs:
3737
script: |
3838
cd example/SampleProject && flutter test integration_test/test_play.dart
3939
cd example/SampleProject && flutter test integration_test/test_conference.dart
40-
41-
# Uncomment and adjust for publishing your package
42-
- name: Setup Pub Credentials
43-
shell: bash
44-
env:
45-
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
46-
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
47-
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
48-
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
49-
run: |
50-
sh ./pub_login.sh
51-
52-
- name: Check Publish Warnings
53-
run: |
54-
sudo cat /$HOME/.config/dart/pub-credentials.json
55-
flutter pub publish --dry-run
56-
57-
- name: Publish Package
58-
if: contains(github.event.head_commit.message, 'release')
59-
run: |
60-
yes | flutter pub publish

0 commit comments

Comments
 (0)