Skip to content

Commit

Permalink
customize workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
blackmann committed Feb 18, 2024
1 parent 1d9e53a commit 76e31f1
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,40 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_call:
inputs:
environment:
description: if specified, the workflow is required to be run in this environment (with additional approvals)
required: false
type: string
working-directory:
description: directory with-in the repository where the package is located (if not in the repository root)
required: false
type: string

jobs:
publish:
name: 'Publish to pub.dev'
environment: ${{ inputs.environment }}
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
# with:
# working-directory: path/to/package/within/repository
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
steps:
# Checkout repository
- uses: actions/checkout@v4
# Setup Dart SDK with JWT token
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
- name: Setup Flutter
id: flutter
uses: DanTup/gh-actions/setup-flutter@master
# Minimal package setup and dry run checks.
- name: Install dependencies
run: dart pub get
working-directory: ${{ inputs.working-directory }}
- name: Publish - dry run
run: dart pub publish --dry-run
working-directory: ${{ inputs.working-directory }}
# Publishing...
- name: Publish to pub.dev
run: dart pub publish -f
working-directory: ${{ inputs.working-directory }}

0 comments on commit 76e31f1

Please sign in to comment.