File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
1
name : Publish Flutter Package
2
2
3
3
on :
4
- workflow_dispatch :
4
+ repository_dispatch :
5
+ types : [publish]
5
6
6
7
jobs :
7
8
publish :
11
12
steps :
12
13
- name : Check out code
13
14
uses : actions/checkout@v3
15
+ with :
16
+ ref : ${{ github.event.client_payload.ref }}
14
17
15
18
- name : Set up Flutter
16
19
uses : subosito/flutter-action@v2
24
27
env :
25
28
PUB_CREDENTIALS : ${{ secrets.PUB_CREDENTIALS }}
26
29
run : |
27
- mkdir -p ~/Library/Application\ Support/dart
28
- echo "$PUB_CREDENTIALS" > ~/Library/Application\ Support/dart/pub-credentials.json
30
+ if [ -z "$XDG_CONFIG_HOME" ]; then
31
+ CREDENTIALS_DIR="$HOME/.config/dart"
32
+ else
33
+ CREDENTIALS_DIR="$XDG_CONFIG_HOME/dart"
34
+ fi
35
+ mkdir -p "$CREDENTIALS_DIR"
36
+ echo "$PUB_CREDENTIALS" > "$CREDENTIALS_DIR/pub-credentials.json"
29
37
30
38
- name : Dry run publish
31
39
run : flutter pub publish --dry-run
34
42
run : yes | flutter pub publish
35
43
36
44
- name : Clean up authentication
37
- run : rm ~/Library/Application\ Support/dart/pub-credentials.json
45
+ run : |
46
+ if [ -z "$XDG_CONFIG_HOME" ]; then
47
+ CREDENTIALS_DIR="$HOME/.config/dart"
48
+ else
49
+ CREDENTIALS_DIR="$XDG_CONFIG_HOME/dart"
50
+ fi
51
+ rm "$CREDENTIALS_DIR/pub-credentials.json"
You can’t perform that action at this time.
0 commit comments