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
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ permissions:
contents: read

jobs:
package-score:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
with:
channel: stable
cache: true
pub-cache: true

- name: Install latest pana
run: dart pub global activate pana

- name: Require maximum pub points
run: dart pub global run pana . --exit-code-threshold 0
Comment thread
KickNext marked this conversation as resolved.

quality:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
51 changes: 43 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,46 @@ jobs:
- name: Validate package
run: dart pub publish --dry-run

publish:
check-version:
needs: validate
runs-on: ubuntu-latest
timeout-minutes: 5
permissions: {}
outputs:
published: ${{ steps.lookup.outputs.published }}

steps:
- name: Check whether the version is already published
id: lookup
shell: bash
run: |
version="${GITHUB_REF_NAME#v}"
status="$(curl --silent --output /dev/null --write-out '%{http_code}' \
"https://pub.dev/api/packages/morphnext/versions/${version}")"
case "${status}" in
200) echo "published=true" >> "${GITHUB_OUTPUT}" ;;
404) echo "published=false" >> "${GITHUB_OUTPUT}" ;;
*)
echo "pub.dev returned HTTP ${status}" >&2
exit 1
;;
esac

publish:
needs: check-version
if: needs.check-version.outputs.published != 'true'
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@7654d458321ee25acccccfdb86cd48bd95768ff1 # v1.8.0
with:
environment: pub.dev

release:
needs: publish
needs: [check-version, publish]
if: >-
always() &&
needs.check-version.result == 'success' &&
(needs.publish.result == 'success' || needs.publish.result == 'skipped')
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
Expand All @@ -68,9 +98,14 @@ jobs:
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create "${GITHUB_REF_NAME}"
--repo "${GITHUB_REPOSITORY}"
--verify-tag
--generate-notes
--title "${GITHUB_REF_NAME}"
shell: bash
run: |
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
echo "GitHub release ${GITHUB_REF_NAME} already exists"
else
gh release create "${GITHUB_REF_NAME}" \
--repo "${GITHUB_REPOSITORY}" \
--verify-tag \
--generate-notes \
--title "${GITHUB_REF_NAME}"
fi
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: morphnext
description: Interruptible vector morphing for Flutter.
description: Interruptible, spring-driven vector icon morphing for Flutter without per-pair animation assets.
version: 0.5.0
homepage: https://kicknext.github.io/morphnext/
repository: https://github.com/KickNext/morphnext
Expand Down