Skip to content

Publish V2

Publish V2 #1

Workflow file for this run

name: Publish V2
on:
workflow_dispatch:
inputs:
working-directory:
description: "Working directory"
required: true
type: choice
options:
- scgateway
- loans
default: "scgateway"
jobs:
publish:
name: "Publish to pub.dev"
permissions:
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
steps:
# Checkout repository
- uses: actions/checkout@v4
# Set up the Dart SDK and provision the OIDC token used for publishing.
# The `dart` command from this step will be shadowed by the one from the
# Flutter SDK below.
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
# Download flutter SDK - needed for publishing Flutter packages. Can also
# publish pure Dart packages.
#
# The dart binary from a Flutter SDK facilitates publishing both Flutter
# and pure-dart packages.
- uses: flutter-actions/setup-flutter@54feb1e258158303e041b9eaf89314dcfbf6d38a
# Minimal package setup and dry run checks.
- name: Install dependencies
run: flutter pub get
working-directory: ${{ inputs.working-directory }}
- name: Publish - dry run
run: flutter pub publish --dry-run
continue-on-error: true
working-directory: ${{ inputs.working-directory }}
# Publishing...
- name: Publish to pub.dev
run: flutter pub publish -f
working-directory: ${{ inputs.working-directory }}