提交 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:
runs-on: ubuntu-latest
steps: steps:
- name: 📚 Git Checkout - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: 🐦 Setup Flutter - name: Publish
uses: subosito/flutter-action@v2 uses: k-paxian/dart-package-publisher@master
- name: 🪪 Get Id Token
uses: actions/github-script@v6
with: with:
script: | credentialJson: ${{ secrets.CREDENTIAL_JSON }}
let pub_token = await core.getIDToken('https://pub.dev') flutter: true
core.exportVariable('PUB_TOKEN', pub_token) skipTests: true
\ 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论