CI - On Release #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - On Release | |
on: | |
push: | |
tags: | |
- "zeta_*v[0-9]+.[0-9]+.[0-9]+*" | |
workflow_dispatch: | |
inputs: | |
package: | |
description: "Package to release" | |
type: choice | |
options: | |
- all | |
- zeta_flutter | |
- zeta_flutter_theme | |
- zeta_flutter_utils | |
- zeta_icons | |
jobs: | |
check-package: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
environment: pub.dev | |
steps: | |
- name: Set package to publish (workflow dispatch) | |
if: github.event_name == 'workflow_dispatch' | |
run: echo package=${{ github.event.inputs.package }} >> $GITHUB_ENV | |
- name: Set package to publish (tag push) | |
if: github.event_name == '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 | |
uses: subosito/flutter-action@v2 | |
with: | |
cache: true | |
channel: stable | |
flutter-version: 3.27.x | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Install melos | |
run: dart pub global activate melos | |
- name: Check Publish Warnings | |
run: melos publish --dry-run | |
- name: Publish all | |
if: ${{ env.package == 'all' }} | |
run: melos publish # --no-dry-run TODO: Uncomment this line to publish | |
- name: Publish individual package | |
if: ${{ env.package != 'all' }} | |
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 | |
needs: check-package | |
steps: | |
- uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
script: | | |
await github.rest.actions.createWorkflowDispatch({ | |
owner: 'zebratechnologies', | |
repo: 'zeta', | |
workflow_id: 'deploy.yml', | |
ref: 'main', | |
}) |