Skip to content

run: publish to pub.dev #13

run: publish to pub.dev

run: publish to pub.dev #13

Workflow file for this run

name: 'run: publish to pub.dev'
on:
workflow_dispatch:
inputs:
release_branch:
description: The branch to be released
type: string
required: true
default: 'main'
jobs:
publishing:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
ref: ${{ inputs.release_branch }}
- name: Get tags
run: git fetch --tags origin
- name: Check Versions 🔎
run: |
set -eo pipefail
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1 HEAD`)
echo "LIB_VERSION: ${LIB_VERSION}"
export PUBSPEC_VERSION=$(grep 'version: ' pubspec.yaml | sed -e 's,.*: \(.*\),\1,')
echo "PUBSPEC_VERSION: ${PUBSPEC_VERSION}"
if [ "$LIB_VERSION" != "${PUBSPEC_VERSION}" ]; then
echo "Version in 'pubspec.yaml' does not match tag.";
exit 1;
fi
- name: Publish Dart Package 🚢
id: publish
uses: k-paxian/dart-package-publisher@master
with:
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
force: true # We have checked the `dart pub publish --dry-run` `in build.yaml`, it's ok to force publish here.
skipTests: true