Skip to content

Merge pull request #26 from bumbii/single_word_clickable_text #30

Merge pull request #26 from bumbii/single_word_clickable_text

Merge pull request #26 from bumbii/single_word_clickable_text #30

name: Publish Flutter Package
on:
pull_request:
types: [closed]
branches:
- main
jobs:
publish:
if: github.event.pull_request.merged == true
name: Publish Package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: widgets
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.0'
- name: Get branch name
id: get_branch
run: |
echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
- name: Install dependencies
run: |
echo "Branch name: ${{ env.BRANCH_NAME }}"
cd widgets/${{ env.BRANCH_NAME }}
flutter pub get
- name: Setup Pub Credentials
shell: bash
env:
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ REFRESH_TOKEN }}
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.EXPIRATION }}
run: |
sh ./pub_login.sh
- name: Publish package
env:
PUB_TOKEN: ${{ secrets.CREDENTIAL_JSON }}
run: |
cd widgets/${{ env.BRANCH_NAME }}
flutter pub publish --dry-run
flutter pub publish --force