Skip to content

CI - On Release

CI - On Release #33

Workflow file for this run

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:
- zeta_flutter
- zeta_flutter_components
- 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 == 'zeta_flutter' }}
run: melos publish # --no-dry-run TODO: Uncomment this line to publish
- 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
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',
})