Skip to content

Commit

Permalink
Update publish.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrintt authored Feb 16, 2024
1 parent 079fafa commit c55fd79
Showing 1 changed file with 9 additions and 32 deletions.
41 changes: 9 additions & 32 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
name: Publish new plugin version
name: Publish to pub.dev

on:
workflow_dispatch:
push:
branches:
- release
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.7.7"
channel: "stable"
- run: |
flutter --version
flutter pub get
flutter analyze --fatal-infos
- name: Create credentials file
run: echo $PUB_CREDENTIALS > ~/pub-credentials.json
env:
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}

- name: Add credentials to Dart folder
run: |
mkdir -p ${XDG_CONFIG_HOME:-${HOME:-default}}/dart
touch ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
cp ~/pub-credentials.json ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
env:
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}

- name: Publish
run: dart pub publish --force
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
# with:
# working-directory: path/to/package/within/repository

0 comments on commit c55fd79

Please sign in to comment.