Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# The gate in front of main. Everything it runs lives once in
# CtrlAltDevelop/ci-workflows, so a fix there fixes all of the packages at
# once — format, analyze --fatal-infos, test, the example, a CHANGELOG entry
# for the pubspec version, and the pub.dev score with no points lost.
# Runs the tests on a pull request into main — and on nothing else.
# The job lives once in CtrlAltDevelop/ci-workflows (dart-test.yml).

name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
Expand All @@ -19,13 +14,11 @@ concurrency:
permissions: {}

jobs:
package:
name: Package
uses: CtrlAltDevelop/ci-workflows/.github/workflows/dart-package.yml@v1.1.0
test:
name: Test
uses: CtrlAltDevelop/ci-workflows/.github/workflows/dart-test.yml@v1.2.0
permissions:
contents: read
with:
sdk: flutter
# The example's screenshot goldens are recorded on macOS; on another
# platform they fail over pixels nobody changed.
runs-on: macos-latest
24 changes: 24 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Publishes the example app to https://ctrlaltdevelop.github.io/indicator_tab_bar/
# when a pull request is merged into main.
# Repo Settings → Pages → Source must be "GitHub Actions".

name: Pages

on:
push:
branches: [main]

concurrency:
group: pages
cancel-in-progress: true

permissions: {}

jobs:
pages:
name: Pages
uses: CtrlAltDevelop/ci-workflows/.github/workflows/[email protected]
permissions:
contents: read
pages: write
id-token: write
76 changes: 8 additions & 68 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Publishes the package to pub.dev when a release is created.
# Publishes the package to pub.dev when a version tag is pushed.
#
# Creating a GitHub release from main tags it, and the tag is what starts this:
# `v1.3.0` publishes version 1.3.0. Nothing is published unless the tag is on
# main, matches the version in pubspec.yaml and has its CHANGELOG entry.
#
# One-off setup on pub.dev (package Admin tab > Automated publishing):
# - enable publishing from GitHub Actions for CtrlAltDevelop/indicator_tab_bar
# - tag pattern: v{{version}}
# - require the GitHub Actions environment: pub.dev
# and create an environment named `pub.dev` in the repository settings, with
# a required reviewer if every publish should be approved by hand.
# `v<version>` publishes that version. The checks (tag on main, matches the
# pubspec, has a CHANGELOG entry) and the one-off pub.dev setup live in
# CtrlAltDevelop/ci-workflows (dart-publish.yml).

name: Publish

Expand All @@ -20,64 +13,11 @@ on:
permissions: {}

jobs:
verify:
name: Verify the release
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

- name: The tag is on main
run: |
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
echo "::error::$GITHUB_REF_NAME is not on main; release from main."
exit 1
fi

- name: The tag matches the pubspec version
run: |
version=$(sed -n 's/^version: *//p' pubspec.yaml | tr -d '\r')
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
echo "::error::Tag $GITHUB_REF_NAME does not match pubspec version $version."
exit 1
fi

- name: The CHANGELOG has an entry for it
run: |
version="${GITHUB_REF_NAME#v}"
if ! grep -q "^## $version\b" CHANGELOG.md; then
echo "::error::CHANGELOG.md has no '## $version' entry."
exit 1
fi

publish:
name: Publish to pub.dev
needs: verify
runs-on: ubuntu-latest
environment: pub.dev
name: Publish
uses: CtrlAltDevelop/ci-workflows/.github/workflows/[email protected]
permissions:
contents: read
# Lets pub.dev trust this run without a stored secret.
id-token: write
steps:
- uses: actions/checkout@v7

# Sets up the credentials pub.dev issues to this run; the Flutter
# setup below brings the SDK `flutter pub publish` needs.
- uses: dart-lang/setup-dart@v1

- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- run: flutter pub get

- name: Dry run
run: flutter pub publish --dry-run

- name: Publish
run: flutter pub publish --force
with:
sdk: flutter
21 changes: 21 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dart / Flutter
.dart_tool/
build/
.packages
.flutter-plugins
.flutter-plugins-dependencies
pubspec.lock

# IDE
.idea/
*.iml
.vscode/

# macOS
.DS_Store

# dart doc output
doc/api/

# Example web scaffolding is only for the live demo.
example/web/
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.4.0

- `LineTabIndicator.widthFactor` — sizes the bar as a fraction of the tab's
width instead of the fixed `indicatorWidth`, so the bar scales with the tab.
It lerps while both sides have one, and switches at the midpoint otherwise.
- Performance: the painter builds each shadow's `Paint` (and its blur
`MaskFilter`) once rather than on every frame.
- The example is published as a live demo on GitHub Pages.

## 1.3.0

- `LineTabIndicator.shadows` — shadows cast by the bar, painted beneath it. A
Expand Down
Loading
Loading