提交 82d34851 authored 作者: JarvanMo's avatar JarvanMo

add automated publishing

上级 94ee82ef
name: Publish to pub.dev name: Publish Flutter package to pub.dev
description: Publish your Flutter package to pub.dev
on: inputs:
push: working-directory:
tags: description: directory with-in the repository where the package is located (if not in the repository root)
- 'v[0-9]+.[0-9]+.[0-9]+*' required: false
jobs: runs:
using: "composite"
steps: steps:
- name: Install Flutter - name: 📚 Git Checkout
run: | uses: actions/checkout@v4
git clone https://github.com/flutter/flutter.git -b stable --depth 1 - name: 🐦 Setup Flutter
export PATH="$PATH:`pwd`/flutter/bin" uses: subosito/flutter-action@v2
flutter doctor
publish: - name: 🪪 Get Id Token
permissions: uses: actions/github-script@v6
id-token: write # Required for authentication using OIDC with:
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 script: |
# with: let pub_token = await core.getIDToken('https://pub.dev')
# working-directory: path/to/package/within/repository core.exportVariable('PUB_TOKEN', pub_token)
\ No newline at end of file
- 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
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论