Skip to content

Commit

Permalink
Fix publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket committed Nov 9, 2023
1 parent c2cc911 commit 49691a1
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 16 deletions.
31 changes: 31 additions & 0 deletions .github/actions/setup-publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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: auth0_flutter/example
run: flutter pub get
shell: bash

- name: Setup Dart SDK for publishing # With JWT token
uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
shell: bash
36 changes: 28 additions & 8 deletions .github/workflows/publish-af.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
name: Publish auth0_flutter to pub.dev

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

# on:
# push:
# 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: Setup Flutter and Dart SDK
uses: ./.github/actions/setup-publish
with:
flutter: ${{ env.flutter }}
working-directory: auth0_flutter

- name: Publish - dry run
run: dart pub publish --dry-run
working-directory: auth0_flutter

# - name: Publish
# run: dart pub publish -f
# working-directory: auth0_flutter
36 changes: 28 additions & 8 deletions .github/workflows/publish-afpi.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
name: Publish auth0_flutter_platform_interface to pub.dev

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

# on:
# push:
# 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: Setup Flutter and Dart SDK
uses: ./.github/actions/setup-publish
with:
flutter: ${{ env.flutter }}
working-directory: auth0_flutter_platform_interface

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

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

0 comments on commit 49691a1

Please sign in to comment.