diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..94f6531 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish to pub.dev + +on: + push: + tags: + # Configure the same tag pattern on pub.dev: v{{version}}. + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + publish: + name: Publish package + environment: 'pub.dev' + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: subosito/flutter-action@v2 + with: + channel: stable + + - uses: dart-lang/setup-dart@v1 + + - name: Install dependencies + run: flutter pub get + + - name: Publish + run: flutter pub publish --force diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28b9ffd..5c43fad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,20 +7,14 @@ on: jobs: package_and_publish: - name: Package and Publish + name: Prepare Release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: token: ${{ secrets.REPO_DEPLOYMENT_TOKEN }} - - uses: google-github-actions/auth@v2 - with: - credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' - - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - - run: flutter pub get - - run: gcloud auth print-identity-token --audiences=https://pub.dev | dart pub token add https://pub.dev + # semantic-release updates the version, commits changelog changes, + # and pushes the release tag that triggers the pub.dev publish workflow. - name: release uses: cycjimmy/semantic-release-action@v4 with: diff --git a/.pubignore b/.pubignore deleted file mode 100644 index 937932b..0000000 --- a/.pubignore +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore generated credentials from google-github-actions/auth -gha-creds-*.json diff --git a/.releaserc.json b/.releaserc.json index e4ea527..48a0a87 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,12 +1,6 @@ { "$schema": "https://json.schemastore.org/semantic-release", - "branches": [ - "main", - { - "name": "next", - "prerelease": "prerelease" - } - ], + "branches": ["main"], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", @@ -14,8 +8,7 @@ [ "@semantic-release/exec", { - "prepareCmd": "sed -i 's/^version: .*$/version: ${nextRelease.version}/' pubspec.yaml", - "publishCmd": "flutter pub publish -f" + "prepareCmd": "sed -i 's/^version: .*$/version: ${nextRelease.version}/' pubspec.yaml" } ], [ diff --git a/CHANGELOG.md b/CHANGELOG.md index ea9e397..9bde3f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ ### BREAKING CHANGES -* * Updates minimum supported SDK version to Dart 3.8. +* Updates minimum supported SDK version to Dart 3.8. * Use build 4.0.0 # [5.1.0](https://github.com/smartive/flutter-design-system-generator/compare/v5.0.0...v5.1.0) (2025-02-25)