Skip to content

Commit c55fd79

Browse files
authored
Update publish.yaml
1 parent 079fafa commit c55fd79

1 file changed

Lines changed: 9 additions & 32 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,14 @@
1-
name: Publish new plugin version
1+
name: Publish to pub.dev
2+
23
on:
3-
workflow_dispatch:
44
push:
5-
branches:
6-
- release
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
77

88
jobs:
99
publish:
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- uses: actions/checkout@v2
14-
- uses: subosito/flutter-action@v2
15-
with:
16-
flutter-version: "3.7.7"
17-
channel: "stable"
18-
- run: |
19-
flutter --version
20-
flutter pub get
21-
flutter analyze --fatal-infos
22-
23-
- name: Create credentials file
24-
run: echo $PUB_CREDENTIALS > ~/pub-credentials.json
25-
env:
26-
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
27-
28-
- name: Add credentials to Dart folder
29-
run: |
30-
mkdir -p ${XDG_CONFIG_HOME:-${HOME:-default}}/dart
31-
touch ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
32-
cp ~/pub-credentials.json ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
33-
env:
34-
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
35-
36-
- name: Publish
37-
run: dart pub publish --force
10+
permissions:
11+
id-token: write # Required for authentication using OIDC
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13+
# with:
14+
# working-directory: path/to/package/within/repository

0 commit comments

Comments
 (0)