Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publish workflow #339

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading