Skip to content

Commit 3ff73cf

Browse files
authored
chore(dart): use melos to publish packages (#1786)
1 parent 96ab1c3 commit 3ff73cf

File tree

2 files changed

+18
-44
lines changed

2 files changed

+18
-44
lines changed

clients/algoliasearch-client-dart/.github/scripts/version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ for package_dir in "${!packages[@]}"; do
2323
echo "Creating new tag..."
2424
git tag "$tag_prefix-$new_version"
2525
git push origin "$tag_prefix-$new_version"
26-
echo "$tag_prefix=true" >> "$GITHUB_OUTPUT"
26+
echo "publish=true" >> "$GITHUB_OUTPUT"
2727
else
2828
echo "Version was not updated in $package_dir."
2929
fi

clients/algoliasearch-client-dart/.github/workflows/publish.yml

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -41,51 +41,25 @@ jobs:
4141
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
4242

4343
outputs:
44-
PUBLISH_CORE: ${{ steps.version.outputs.core }}
45-
PUBLISH_SEARCH: ${{ steps.version.outputs.search }}
46-
PUBLISH_INSIGHTS: ${{ steps.version.outputs.insights }}
47-
PUBLISH_ALGOLIASEARCH: ${{ steps.version.outputs.algoliasearch }}
44+
PUBLISH: ${{ steps.version.outputs.publish }}
4845

49-
publish_algoliasearch:
46+
publish:
5047
needs: version
51-
name: Publish AlgoliaSearch
52-
if: ${{ needs.version.outputs.PUBLISH_ALGOLIASEARCH == 'true' }}
53-
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
48+
name: Publish
49+
runs-on: ubuntu-20.04
50+
if: ${{ needs.version.outputs.PUBLISH == 'true' }}
5451
permissions:
5552
id-token: write
56-
with:
57-
environment: 'pub.dev'
58-
working-directory: packages/algoliasearch
59-
60-
publish_core:
61-
needs: version
62-
name: Publish Client Core
63-
if: ${{ needs.version.outputs.PUBLISH_CORE == 'true' }}
64-
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
65-
permissions:
66-
id-token: write
67-
with:
68-
environment: 'pub.dev'
69-
working-directory: packages/client-core
70-
71-
publish_search:
72-
needs: version
73-
name: Publish Search Client
74-
if: ${{ needs.version.outputs.PUBLISH_SEARCH == 'true' }}
75-
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
76-
permissions:
77-
id-token: write
78-
with:
79-
environment: 'pub.dev'
80-
working-directory: packages/client-search
53+
environment: pub.dev
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: dart-lang/setup-dart@v1
8157

82-
publish_insights:
83-
needs: version
84-
name: Publish Insights Client
85-
if: ${{ needs.version.outputs.PUBLISH_INSIGHTS == 'true' }}
86-
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
87-
permissions:
88-
id-token: write
89-
with:
90-
environment: 'pub.dev'
91-
working-directory: packages/client-insights
58+
- name: Install Tools
59+
run: dart pub global activate melos
60+
- name: Bootstrap Workspace
61+
run: melos bootstrap
62+
- name: Install dependencies
63+
run: melos get
64+
- name: Publish packages
65+
run: melos publish --no-dry-run --yes

0 commit comments

Comments
 (0)