Skip to content

Commit

Permalink
add publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyl committed Nov 6, 2024
1 parent 8f418c9 commit fbd405d
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/publish.yml
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

0 comments on commit fbd405d

Please sign in to comment.