Skip to content

Commit

Permalink
Update release to use OIDC token
Browse files Browse the repository at this point in the history
  • Loading branch information
crow committed Nov 9, 2024
1 parent 02e092f commit f71beb5
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
release-plugin:
runs-on: ubuntu-latest
needs: [ ci ]
permissions:
id-token: write # Required for authentication using OIDC
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -60,24 +62,9 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: flutter pub get

- name: Setup pub credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/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": ${{secrets.OAUTH_EXPIRATION }}
}
EOF
mkdir -p ~/Library/Application\ Support/dart/
cp ~/.pub-cache/credentials.json ~/Library/Application\ Support/dart/pub-credentials.json
cp ~/.pub-cache/credentials.json $PUB_CACHE/credentials.json || true
- uses: dart-lang/setup-dart@v1
- name: Publish Dart/Flutter package
run: flutter pub publish -f
run: flutter pub publish --force

- name: Github Release
uses: actions/[email protected]
Expand Down Expand Up @@ -143,4 +130,4 @@ jobs:
with:
type: ${{ job.status }}
job_name: ":raised_hands: Airship Flutter Plugin Released! :raised_hands:"
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }}

0 comments on commit f71beb5

Please sign in to comment.