Skip to content

Commit 8ff3ae9

Browse files
feat: add GitHub Actions workflow for publishing Dart packages to pub.dev
1 parent 77b3449 commit 8ff3ae9

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/publishV2.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish V2
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
working-directory:
7+
description: "Working directory"
8+
required: true
9+
type: choice
10+
options:
11+
- scgateway
12+
- loans
13+
default: "scgateway"
14+
15+
jobs:
16+
publish:
17+
name: "Publish to pub.dev"
18+
permissions:
19+
id-token: write # This is required for requesting the JWT
20+
runs-on: ubuntu-latest
21+
steps:
22+
# Checkout repository
23+
- uses: actions/checkout@v4
24+
# Set up the Dart SDK and provision the OIDC token used for publishing.
25+
# The `dart` command from this step will be shadowed by the one from the
26+
# Flutter SDK below.
27+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
28+
# Download flutter SDK - needed for publishing Flutter packages. Can also
29+
# publish pure Dart packages.
30+
#
31+
# The dart binary from a Flutter SDK facilitates publishing both Flutter
32+
# and pure-dart packages.
33+
- uses: flutter-actions/setup-flutter@54feb1e258158303e041b9eaf89314dcfbf6d38a
34+
# Minimal package setup and dry run checks.
35+
- name: Install dependencies
36+
run: flutter pub get
37+
working-directory: ${{ inputs.working-directory }}
38+
- name: Publish - dry run
39+
run: flutter pub publish --dry-run
40+
continue-on-error: true
41+
working-directory: ${{ inputs.working-directory }}
42+
# Publishing...
43+
- name: Publish to pub.dev
44+
run: flutter pub publish -f
45+
working-directory: ${{ inputs.working-directory }}

0 commit comments

Comments
 (0)