forked from AgoraIO-Extensions/Agora-Flutter-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] add pubdev-publishing action to publish pub.dev manually
- Loading branch information
1 parent
65897ee
commit ba73a1f
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 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`) | ||
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/[email protected] | ||
with: | ||
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} | ||
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} | ||
skipTests: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters