-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Publish to pub.dev and release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.*' # tag pattern on pub.dev: 'v{{version}' | ||
- 'dartcv4-v[0-9]+.[0-9]+.*' | ||
|
||
jobs: | ||
test: | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: robinraju/[email protected] | ||
with: | ||
repository: "rainyl/opencv_dart" | ||
tag: "dnn_test_files" | ||
fileName: "models.zip" | ||
out-file-path: "packages/dartcv/test/" | ||
extract: true | ||
- uses: robinraju/[email protected] | ||
with: | ||
repository: "rainyl/dartcv" | ||
latest: true | ||
fileName: "libdartcv-windows-x64-vs2019.tar.gz" | ||
out-file-path: "packages/dartcv/libdartcv" | ||
extract: true | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
- name: test | ||
run: | | ||
cd "${{github.workspace}}\packages\dartcv" | ||
$env:PATH="${{github.workspace}}\packages\dartcv\libdartcv\lib;$env:PATH" | ||
dart pub global activate coverage | ||
dart pub global run coverage:test_with_coverage --package . --package-name dartcv4 | ||
publish-dartcv4: | ||
if: startsWith(github.ref, 'refs/tags/dartcv4-v') | ||
name: Publish dartcv4 | ||
needs: [test] | ||
permissions: | ||
id-token: write # Required for authentication using OIDC | ||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 | ||
with: | ||
# Specify the github actions deployment environment | ||
environment: pub.dev | ||
working-directory: packages/dartcv | ||
publish-opencv-core: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
name: Publish opencv_core | ||
needs: [test] | ||
permissions: | ||
id-token: write # Required for authentication using OIDC | ||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 | ||
with: | ||
# Specify the github actions deployment environment | ||
environment: pub.dev | ||
working-directory: packages/opencv_core | ||
publish-opencv-dart: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
name: Publish opencv_dart | ||
needs: [test] | ||
permissions: | ||
id-token: write # Required for authentication using OIDC | ||
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 | ||
with: | ||
# Specify the github actions deployment environment | ||
environment: pub.dev | ||
working-directory: packages/opencv_dart | ||
release: | ||
needs: [test] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
draft: false | ||
prerelease: false |