Merge pull request #7 from ebabhi/main #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/publish.yml | |
name: Publish to pub.dev | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' # for tags like: 'v1.2.3' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📚 Git Checkout | |
uses: actions/checkout@v4 | |
- name: 🐦 Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
- name: 📦 Install Dependencies | |
run: flutter pub get | |
- name: 🔐 Setup Pub Credentials | |
run: | | |
mkdir -p $XDG_CONFIG_HOME/dart | |
echo "$XDG_CONFIG_HOME/dart/pub-credentials.json" | |
cat <<EOF > "$XDG_CONFIG_HOME/dart/pub-credentials.json" | |
{ | |
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}", | |
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}", | |
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token", | |
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ], | |
"expiration": 1570721159347 | |
} | |
EOF | |
- name: 📝 Format Code | |
run: dart format . | |
- name: 📝 Analyze Code | |
run: dart analyze . | |
- name: 🚀 Publish package | |
run: dart pub publish -f |