Skip to content

Commit

Permalink
Reusable workflow for publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Jan 4, 2023
1 parent 745c09d commit a05eb35
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pub-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish to pub.dev

## Caller of this workflow should use it as follows:
## jobs:
## publish:
## uses: dart-lang/setup-dart/.github/workflows/pub-publish.yml
## # with:
## # working-directory: path/to/sub/directory

on:
workflow_call:
inputs:
working-directory:
required: false
type: string

jobs:
pub-publish:
permissions:
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart
- name: Install dependencies
run: dart pub get
working-directory: ${{ inputs.working-directory }}
- name: Analyze
run: dart analyze
working-directory: ${{ inputs.working-directory }}
- name: Publish - dry run
run: dart pub publish --dry-run
working-directory: ${{ inputs.working-directory }}
- name: Publish to pub.dev
run: dart pub publish -f
working-directory: ${{ inputs.working-directory }}

0 comments on commit a05eb35

Please sign in to comment.