Skip to content

Commit

Permalink
Merge pull request #1525 from famedly/td/fixAgain
Browse files Browse the repository at this point in the history
chore: use oidc instead of a session token to publish to pub
  • Loading branch information
techno-disaster authored Jul 19, 2023
2 parents 7d4c9dd + 43a5bc7 commit 1ac4259
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,3 @@ jobs:
run: |
dart pub get
dart pub publish --dry-run
pub-dev:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
container:
image: dart:${{inputs.dart_version}}
steps:
- uses: actions/checkout@v3
- name: pub.dev publish
run: |
if [ -z "${{ secrets.PUB_DEV_CREDENTIALS }}" ]; then
echo "Missing PUB_DEV_CREDENTIALS environment variable"
exit 1
fi
mkdir -p ~/.config/dart/
cp "${{ secrets.PUB_DEV_CREDENTIALS }}" ~/.config/dart/pub-credentials.json
dart pub get
dart pub publish --force
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish to pub.dev

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

# Publish using the reusable workflow from dart-lang.
jobs:
publish:
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: pub.dev

0 comments on commit 1ac4259

Please sign in to comment.