Skip to content

Commit

Permalink
Merge pull request #38 from passageidentity/PSG-3992
Browse files Browse the repository at this point in the history
PSG-3992
  • Loading branch information
SinaSeylani authored Jun 4, 2024
2 parents 66bf299 + 450b6c0 commit a81b186
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Publish Flutter Package

on:
workflow_dispatch:
repository_dispatch:
types: [publish]

jobs:
publish:
Expand All @@ -11,6 +12,8 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.ref }}

- name: Set up Flutter
uses: subosito/flutter-action@v2
Expand All @@ -24,8 +27,13 @@ jobs:
env:
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
run: |
mkdir -p ~/Library/Application\ Support/dart
echo "$PUB_CREDENTIALS" > ~/Library/Application\ Support/dart/pub-credentials.json
if [ -z "$XDG_CONFIG_HOME" ]; then
CREDENTIALS_DIR="$HOME/.config/dart"
else
CREDENTIALS_DIR="$XDG_CONFIG_HOME/dart"
fi
mkdir -p "$CREDENTIALS_DIR"
echo "$PUB_CREDENTIALS" > "$CREDENTIALS_DIR/pub-credentials.json"
- name: Dry run publish
run: flutter pub publish --dry-run
Expand All @@ -34,4 +42,10 @@ jobs:
run: yes | flutter pub publish

- name: Clean up authentication
run: rm ~/Library/Application\ Support/dart/pub-credentials.json
run: |
if [ -z "$XDG_CONFIG_HOME" ]; then
CREDENTIALS_DIR="$HOME/.config/dart"
else
CREDENTIALS_DIR="$XDG_CONFIG_HOME/dart"
fi
rm "$CREDENTIALS_DIR/pub-credentials.json"

0 comments on commit a81b186

Please sign in to comment.