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
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: rlespinasse/github-slug-action@v4.4.1 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
cache: true | |
- run: flutter pub get | |
- name: Set release version | |
run: echo RELEASE_VERSION=$(echo ${{ env.GITHUB_REF_NAME }}|cut -c2-) >> $GITHUB_ENV | |
- name: Set pubspec version | |
uses: mikefarah/yq@master | |
with: | |
cmd: yq eval -i '.version = "${{ env.RELEASE_VERSION }}"' pubspec.yaml | |
- name: Setup credentials | |
run: | | |
mkdir -p $XDG_CONFIG_HOME/dart | |
cat <<EOF > $XDG_CONFIG_HOME/dart/pub-credentials.json | |
{ | |
"accessToken":"${{ secrets.PUB_OAUTH_ACCESS_TOKEN }}", | |
"refreshToken":"${{ secrets.PUB_OAUTH_REFRESH_TOKEN }}", | |
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token", | |
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ], | |
"expiration": 1673608638916 | |
} | |
EOF | |
- name: Publish package | |
continue-on-error: false | |
run: flutter pub publish -f |