Skip to content

Commit

Permalink
ci!: implement ci deployment to pub.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Takla committed Apr 25, 2024
1 parent d139aad commit 3cea562
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
27 changes: 20 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ pr:
include:
- main

variables:
- name: IsReleaseBranch # Should this branch name use the release stage
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]

pool:
vmImage: ubuntu-20.04

Expand Down Expand Up @@ -46,10 +50,19 @@ steps:
- script: flutter pub publish --dry-run
displayName: 'Run flutter pub publish --dry-run'








- task: DownloadSecureFile@1
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['IsReleaseBranch'], 'true'))
inputs:
secureFile: 'flutter_publisher_gckey.json'
name: DownloadGCloudKey

- script: |
gcloud auth activate-service-account --key-file=$(DownloadGCloudKey.secureFilePath)
gcloud auth print-identity-token --audiences=https://pub.dev | dart pub token add https://pub.dev
dart pub publish --force
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['IsReleaseBranch'], 'true'))
displayName: 'Publish to pub.dev as a nventive publisher'

- task: PostBuildCleanup@3
displayName: 'Post-Build Cleanup: Cleanup files to keep build server clean!'
condition: always()
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: requests_signature_dart
description: "A Dart package for making HTTP requests with cryptographic signatures."
version: 0.9.9 # The version will be overriden in the CI following semantic versioning.
homepage: https://github.com/nventive/RequestsSignature-Dart
repository: https://github.com/nventive/RequestsSignature-Dart
issue_tracker: https://github.com/nventive/RequestsSignature-Dart/issues

environment:
sdk: '>=2.12.0 <4.0.0'
Expand Down

0 comments on commit 3cea562

Please sign in to comment.