Skip to content

Commit

Permalink
Update dart.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mocolicious authored Jul 17, 2024
1 parent 027cb11 commit 61e23d3
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@ jobs:
# - name: Run tests
# run: flutter test

- name: Publish to pub.dev (dry run)
- name: Create credentials.json
env:
PUBDEV_TOKEN: ${{ secrets.PUBDEV_TOKEN }}
run: |
mkdir -p ~/.pub-cache
echo "{\"https://pub.dev\": {\"token\": \"$PUBDEV_TOKEN\"}}" > ~/.pub-cache/credentials.json
flutter pub publish --dry-run
cat ~/.pub-cache/credentials.json # Add debugging to ensure file is created correctly
ls -la ~/.pub-cache # List contents of the directory for debugging
- name: Publish to pub.dev (dry run)
run: flutter pub publish --dry-run

- name: Publish to pub.dev
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
env:
PUBDEV_TOKEN: ${{ secrets.PUBDEV_TOKEN }}
run: |
mkdir -p ~/.pub-cache
echo "{\"https://pub.dev\": {\"token\": \"$PUBDEV_TOKEN\"}}" > ~/.pub-cache/credentials.json
flutter pub publish --force
run: flutter pub publish --force

0 comments on commit 61e23d3

Please sign in to comment.