提交 3fa944e6 authored 作者: JarvanMo's avatar JarvanMo

add automated publishing

上级 82d34851
name: Publish Flutter package to pub.dev
description: Publish your Flutter package to pub.dev
name: Publish to pub.dev
inputs:
working-directory:
description: directory with-in the repository where the package is located (if not in the repository root)
required: false
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
runs:
using: "composite"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
- name: 🪪 Get Id Token
uses: actions/github-script@v6
- name: Checkout repo
uses: actions/checkout@v3
- name: Publish
uses: k-paxian/dart-package-publisher@master
with:
script: |
let pub_token = await core.getIDToken('https://pub.dev')
core.exportVariable('PUB_TOKEN', pub_token)
- name: 📢 Authenticate
shell: ${{ inputs.shell }}
run: flutter pub pub token add https://pub.dev --env-var PUB_TOKEN
- name: 📦 Install dependencies
shell: ${{ inputs.shell }}
run: flutter pub get
working-directory: ${{ inputs.working-directory }}
- name: 🌵 Dry Run
shell: ${{ inputs.shell }}
run: flutter pub publish --dry-run
working-directory: ${{ inputs.working-directory }}
- name: 📢 Publish
shell: ${{ inputs.shell }}
run: flutter pub publish -f
working-directory: ${{ inputs.working-directory }}
\ No newline at end of file
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
flutter: true
skipTests: true
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论