Files
breez-sdk-liquid/.github/workflows/publish-dart.yml
Ross Savage 3ea6b1a9dc Publish Dart and Flutter packages (#356)
* Publish flutter artifacts and package

* Publish dart package

* Add LICENCE

* Force rm

* Don't copy lock files

* Fix output directory

* Fix podspec name

* Pass SWIFT_RELEASE_TOKEN

* Fix overrides indentation

* Update package version on CMake script

Update example dependencies

* Depend on dart & flutter packages from git on pubspec files

* Correct repository links & add publish_to: 'none'
* run just clean && just init

* Update README.md

* Download framework as part of prepare_command

* Use wget, then fallback to curl
* Remove redundant .zip suffix on the url

* Fix release tag

* Add v to tag replacement

* Fix podspec version

* Copy header file

* Downgrade vm_service

---------

Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
2024-07-03 17:21:47 +02:00

86 lines
2.6 KiB
YAML

name: Publish Dart Package
on:
workflow_call:
inputs:
repository:
description: 'sdk repository, defaults to current repository'
required: false
type: string
ref:
description: 'commit/tag/branch reference'
required: true
type: string
package-version:
description: 'version for the dart package (MAJOR.MINOR.BUILD) (no v prefix)'
required: true
type: string
publish:
description: 'value indicating whether to commit/tag a release.'
required: true
type: boolean
default: true
secrets:
REPO_SSH_KEY:
description: 'ssh key to commit to the breez-liquid-sdk-dart repository'
required: true
jobs:
build-tag-release:
runs-on: ubuntu-latest
steps:
- name: Checkout breez-liquid-sdk-dart repo
uses: actions/checkout@v3
with:
repository: breez/breez-liquid-sdk-dart
ssh-key: ${{ secrets.REPO_SSH_KEY }}
fetch-depth: 0
path: dist
- name: Checkout breez-liquid-sdk repo
uses: actions/checkout@v3
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.sha }}
path: build
- name: Copy package files
working-directory: dist
run: |
rm -rf lib
cp -r ../build/packages/dart/lib .
cp ../build/packages/dart/analysis_options.yaml .
cp ../build/packages/dart/pubspec.yaml .
- name: Copy docs
working-directory: dist
run: |
cp ../build/packages/dart/CHANGELOG.md . || true
cp ../build/packages/dart/LICENSE . || true
cp ../build/packages/dart/README.md . || true
- name: Set package version
working-directory: dist
run: |
sed -i.bak -e 's/version:.*/version: ${{ inputs.package-version }}/' pubspec.yaml
rm pubspec.yaml.bak
- name: Archive Dart release
uses: actions/upload-artifact@v3
with:
name: breez-liquid-sdk-dart-${{ inputs.package-version || github.sha }}
path: |
dist/*
!dist/.git
- name: Tag the Dart package
working-directory: dist
if: ${{ inputs.publish }}
run: |
git config --global user.email github-actions@github.com
git config --global user.name github-actions
git add .
git commit -m "Update Dart package to version v${{ inputs.package-version }}"
git push
git tag v${{ inputs.package-version }} -m "v${{ inputs.package-version }}"
git push --tags