chore(ci): create tag and publish when pubspec version changes
This commit is contained in:
parent
2a93440b85
commit
d10765ad75
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: Auto Tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [Code Check]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-tag:
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: "Auto Tag when the pubspec.yaml version changes"
|
||||||
|
uses: jacopocarlini/action-autotag@3.0.0
|
||||||
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.TAG_TOKEN }}
|
||||||
|
tag_prefix: "v"
|
||||||
|
|
@ -20,6 +20,7 @@ jobs:
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
|
cache: true
|
||||||
|
|
||||||
- name: Run Flutter Test
|
- name: Run Flutter Test
|
||||||
run: flutter test
|
run: flutter test
|
||||||
|
|
@ -33,6 +34,7 @@ jobs:
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
|
cache: true
|
||||||
|
|
||||||
- name: Run Flutter Format
|
- name: Run Flutter Format
|
||||||
run: dart format --set-exit-if-changed .
|
run: dart format --set-exit-if-changed .
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,33 @@
|
||||||
name: release
|
name: Publish to pub.dev
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
push:
|
||||||
workflows: [Code Check]
|
tags:
|
||||||
types:
|
- "v[0-9]+.[0-9]+.[0-9]"
|
||||||
- completed
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
publish:
|
||||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Dart
|
||||||
|
uses: dart-lang/setup-dart@v1
|
||||||
|
with:
|
||||||
|
sdk: stable
|
||||||
|
|
||||||
- name: "Install Flutter"
|
- name: "Install Flutter"
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
|
cache: true
|
||||||
|
|
||||||
- name: Get all Flutter Packages
|
- name: Get all Flutter Packages
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish to pub.dev
|
||||||
uses: sakebook/actions-flutter-pub-publisher@v1.4.1
|
run: flutter pub publish
|
||||||
with:
|
|
||||||
credential: ${{ secrets.CREDENTIAL_JSON }}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue