-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.46 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: publish
on:
push:
tags: # trigger the publish job on tag creation
- "*"
jobs:
test:
uses: ./.github/workflows/browser-tests.yaml
publish_github_release:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
bodyFile: "RELEASE.md"
publish_pub_dev:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter doctor -v
- name: Update GITHUB_RUN_NUMBER to version
run: ./update_version.sh
- name: Prepare pub credentials
run: mkdir -p $XDG_CONFIG_HOME/dart && echo '${{ secrets.CREDENTIAL_JSON }}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json"
- name: Publish package
run: |
flutter pub publish --dry-run
flutter pub publish --force
- name: Git commit the updated pubspec.yaml
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add pubspec.yaml
if [ -n "$(git status --porcelain)" ]; then
git commit -m "chore: updated the version of pubspec.yaml"
git push
fi
deploy:
needs: publish_pub_dev
uses: ./.github/workflows/deploy.yaml