提交 32bbf9e0 authored 作者: JarvanMo's avatar JarvanMo

add automated publishing

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