-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (34 loc) · 1.21 KB
/
publish.yml
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
# .github/workflows/publish.yml
name: Publish to pub.dev
on:
push:
tags:
# must align with the tag-pattern configured on pub.dev, often just replace
# with [0-9]+.[0-9]+.[0-9]+*
- 'v[0-9]+.[0-9]+.[0-9]+*' # tag-pattern on pub.dev: 'v'
# If you prefer tags like '1.2.3', without the 'v' prefix, then use:
# - '[0-9]+.[0-9]+.[0-9]+*' # tag-pattern on pub.dev: ''
# If your repository contains multiple packages consider a pattern like:
# - 'my_package_name-v[0-9]+.[0-9]+.[0-9]+*'
# Publish using the reusable workflow from dart-lang.
jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for authentication using OIDC
steps:
# Checkout the repo
- name: Checkout repository
uses: actions/checkout@v3
# Set up Flutter
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable # You can specify a specific Flutter version if needed
flutter-version-file: pubspec.yaml
# Install dependencies
- name: Install dependencies
run: flutter pub get
# Publish package to pub.dev
- name: Publish to pub.dev
run: flutter pub publish --force