Skip to content

Commit

Permalink
ci: add workflow dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton committed Feb 4, 2025
1 parent 2654a18 commit c8ff06f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 73 deletions.
53 changes: 32 additions & 21 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ on:
push:
tags:
- "zeta_*v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
inputs:
package:
description: "Package to release"
type: choice
options:
- zeta_flutter
- zeta_flutter_components
- zeta_flutter_theme
- zeta_flutter_utils
- zeta_icons

jobs:
check-package:
Expand All @@ -11,6 +22,18 @@ jobs:
id-token: write
environment: pub.dev
steps:
- name: Set package to publish (workflow dispatch)
run: echo package=${{ github.event.inputs.package }} >> $GITHUB_ENV
- name: Set package to publish (tag push)
run: |
p=zeta_flutter
for package in zeta_flutter zeta_flutter_components zeta_flutter_theme zeta_flutter_utils zeta_icons; do
if [[ "${GITHUB_REF}" == *"${package}"* ]]; then
p=$package
break
fi
echo "package=${p}" >> $GITHUB_ENV
done
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- name: Install Flutter
Expand All @@ -25,29 +48,17 @@ jobs:
run: pub global activate melos
- name: Check Publish Warnings
run: melos publish --dry-run

- name: Publish all
if: github.ref_name.contains('zeta_flutter') && !github.ref_name.contains('utils') && !github.ref_name.contains('theme') && !github.ref_name.contains('components')
if: ${{ env.package == 'zeta_flutter' }}
run: melos publish # --no-dry-run TODO: Uncomment this line to publish
- name: Publish zeta_flutter (components)
if: github.ref_name.contains('zeta_flutter_components')
uses: ./.github/workflows/release-individual-package.yml
with:
package: zeta_flutter
- name: Publish zeta_flutter_theme
if: github.ref_name.contains('zeta_flutter_theme')
uses: ./.github/workflows/release-individual-package.yml
with:
package: zeta_flutter_theme
- name: Publish zeta_flutter_utils
if: github.ref_name.contains('zeta_flutter_utils')
uses: ./.github/workflows/release-individual-package.yml
with:
package: zeta_flutter_utils
- name: Publish zeta_icons
if: github.ref_name.contains('zeta_icons')
uses: ./.github/workflows/release-individual-package.yml
with:
package: zeta_icons

- name: Publish individual package
if: ${{ env.package != 'zeta_flutter' }}
run: |
cd packages/${{ env.package }}
flutter pub publish --dry-run
flutter pub publish # --no-dry-run TODO: Uncomment this line to publish
deploy-website:
runs-on: ubuntu-latest
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/release-individual-package.yml

This file was deleted.

0 comments on commit c8ff06f

Please sign in to comment.