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
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish to pub.dev

on:
push:
tags:
- '*.*.*'

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Dart SDK
uses: dart-lang/setup-dart@v1

- name: Install dependencies
run: dart pub get

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Analyze package
run: dart analyze

- name: Run package:test suite
run: dart test

- name: Run legacy assertion suite
run: dart --enable-asserts run test/all.dart

- name: Validate publishable package
run: dart pub publish --dry-run

publish-pub-dev:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: validate
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
25 changes: 3 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release

on:
push:
tags:
- 'v*'
release:
types:
- published

jobs:
validate:
Expand Down Expand Up @@ -33,22 +33,3 @@ jobs:

- name: Validate publishable package
run: dart pub publish --dry-run

github-release:
needs: validate
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, '-') }}

publish-pub-dev:
needs: validate
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ Tagged releases are handled through GitHub Actions.
Use the current package version from `pubspec.yaml` and create a matching Git tag:

```sh
git tag v<version>
git push origin v<version>
git tag <version>
git push origin <version>
```

Then publish a GitHub release for the same tag.

If the package name is being published to pub.dev for the first time, the first release must be performed manually before automated publishing can be used.

## Reporting Issues
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,20 @@ dart analyze
dart test
dart --enable-asserts run test/all.dart
dart pub publish --dry-run
git tag v<version>
git push origin v<version>
git tag <version>
git push origin <version>
```

If `flutter_ed448` is being published to pub.dev for the first time, the initial release must still be published manually. After that, the included GitHub Actions release workflow can publish tagged versions automatically once pub.dev automated publishing is configured for this repository.
After pushing the version tag, publish a GitHub release for the same tag, for example `0.2.0`.

The workflows are split as follows:

- Publishing a GitHub release runs the repository `Release` workflow.
- Pushing a matching version tag runs the `Publish to pub.dev` workflow.

The pub.dev publish step must stay tag-triggered. Dart's official automated publishing flow only allows GitHub Actions publishing when the workflow was triggered by a pushed git tag, not only by a GitHub release event.

If `flutter_ed448` is being published to pub.dev for the first time, the initial release must still be published manually. After that, automated publishing can be enabled for this repository on pub.dev using the plain version tag pattern `{{version}}`.

## Licensing

Expand Down
Loading