Skip to content

Commit

Permalink
Fix publish workflow (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket authored Nov 10, 2023
1 parent c2cc911 commit 62f9050
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 8 deletions.
30 changes: 30 additions & 0 deletions .github/actions/setup-publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Set up Flutter and Dart SDK for publishing
description: Set up the environment for publishing the Flutter libraries to pub.dev

inputs:
flutter:
description: The version of Flutter to use
required: true

working-directory:
description: The directory of the package to publish
required: true

runs:
using: composite

steps:
- name: Install Flutter
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
flutter-version: ${{ inputs.flutter }}
channel: stable
cache: true

- name: Install Flutter dependencies
working-directory: ${{ inputs.working-directory }}
run: flutter pub get
shell: bash

- name: Setup Dart SDK for publishing # With JWT token
uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
25 changes: 21 additions & 4 deletions .github/workflows/publish-af.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@ on:
tags:
- 'af-v[0-9]+.[0-9]+.[0-9]+*'

env:
flutter: '3.x'

jobs:
publish:
name: Publish auth0_flutter to pub.dev
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
runs-on: ubuntu-latest

permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
working-directory: auth0_flutter

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Setup Flutter and Dart SDK
uses: ./.github/actions/setup-publish
with:
flutter: ${{ env.flutter }}
working-directory: auth0_flutter

- name: Publish
run: dart pub publish -f
working-directory: auth0_flutter
25 changes: 21 additions & 4 deletions .github/workflows/publish-afpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,28 @@ on:
tags:
- 'afpi-v[0-9]+.[0-9]+.[0-9]+*'

env:
flutter: '3.x'

jobs:
publish:
name: Publish auth0_flutter_platform_interface to pub.dev
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
runs-on: ubuntu-latest

permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: ${{ github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
working-directory: auth0_flutter_platform_interface

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Setup Flutter and Dart SDK
uses: ./.github/actions/setup-publish
with:
flutter: ${{ env.flutter }}
working-directory: auth0_flutter_platform_interface

- name: Publish
run: dart pub publish -f
working-directory: auth0_flutter_platform_interface

0 comments on commit 62f9050

Please sign in to comment.