Skip to content

Commit de485be

Browse files
author
lask
authored
Merge pull request #47 from lakscastro/feat/auto-publish-on-push-release
Add automatic publish package on push to `release` branch
2 parents b0d26aa + 5fdbf8b commit de485be

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Publish new plugin version
22
on:
3+
workflow_dispatch:
34
push:
45
branches:
56
- release
@@ -12,10 +13,24 @@ jobs:
1213
- uses: actions/checkout@v2
1314
- uses: dart-lang/setup-dart@v1
1415

16+
- name: Checkout to release branch
17+
run: |
18+
git fetch
19+
git checkout ${{ github.ref_name }}
20+
21+
- name: Create credentials file
22+
run: echo $PUB_CREDENTIALS > ~/pub-credentials.json
23+
env:
24+
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
25+
26+
- name: Add credentials to Dart folder
27+
run: |
28+
mkdir -p ${XDG_CONFIG_HOME:-${HOME:-default}}/dart
29+
touch ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
30+
cp ~/pub-credentials.json ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
31+
env:
32+
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
33+
1534
- name: Publish
16-
uses: sakebook/actions-flutter-pub-publisher@v1.3.1
17-
with:
18-
credential: ${{ secrets.PUB_CREDENTIALS }}
19-
flutter_package: true
20-
skip_test: true
21-
dry_run: true
35+
run: dart pub publish --force
36+

0 commit comments

Comments
 (0)