diff --git a/.github/workflows/publish_package.yaml b/.github/workflows/publish_package.yaml new file mode 100644 index 0000000..a58064d --- /dev/null +++ b/.github/workflows/publish_package.yaml @@ -0,0 +1,43 @@ +name: Run Test Cases And Publish Package + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + if: contains(github.event.head_commit.message, 'release') + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + + # Uncomment and adjust for publishing your package + - name: Setup Pub Credentials + shell: bash + env: + PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }} + PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }} + PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }} + PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }} + run: | + sh ./pub_login.sh + + - name: Check Publish Warnings + run: | + sudo cat /$HOME/.config/dart/pub-credentials.json + flutter pub publish --dry-run + + - name: Publish Package + run: | + yes | flutter pub publish