Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(release): update release process #58

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 1 addition & 6 deletions .github/workflows/example_app_release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
name: Make example app release PR

on:
pull_request_target:
types:
- labeled
branches:
- main
workflow_dispatch:

jobs:
pull-request-creation:
if: contains(github.event.pull_request.labels.*.name, format('autorelease{0} tagged', ':')) || github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch'
permissions:
pull-requests: write
contents: write
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/publish_pub_dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Publish to pub.dev

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+" # tag pattern on pub.dev: '{{version}'
workflow_dispatch:

# Publish using custom workflow
jobs:
Expand Down
10 changes: 7 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ The releases will be done through [Release Please]. This project uses the [Githu

All configuration files for [Release Please] are found in the `./ci` directory.

### Pub Dev

The pub dev release is done by running the `publish_pub_dev` Github action.
Copy link

@josxha josxha Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Nico, I just happened to come across this pr. It could be that triggering a release with workflow_dispatch will be blocked by pub.dev.

Pub.dev only allows automated publishing from GitHub Actions when the workflow is triggered by pushing a git tag to GitHub. Pub.dev rejects publishing from GitHub Actions triggered without a tag. This ensures that new versions cannot be published by events that should never trigger publishing.

See https://dart.dev/tools/pub/automated-publishing#publishing-packages-using-github-actions

P.S. Awesome work you're doing for the SBB!

Copy link
Collaborator Author

@smallTrogdor smallTrogdor Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @josxha

glad to have you peeking in here ;)
and have you review some of my work (I really do mean that!). Maybe you now understand some more of my comments in previous issues (e.g. maplibre/flutter-maplibre-gl#436). And you might understand why I am very much excited for the iOS part of https://github.com/josxha/flutter-maplibre !

There's a couple of applications using this package by now :)

To your comment. Yes, I need to improve upon the CI / CD part for sure. I found this for the workflow_dispatch trigger type and publishing to pub dev: dart-lang/pub-dev#7177 (comment)

So I guess I will change this action to checkout a tag ref first (the one selected). The other option is that I directly trigger using the

on:
  push:
    tags:

style, but having a Github App do the Release Please part. Otherwise, the merge of the outstanding PRs from Release Please will not do anything (not triggering subsequent workflows).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And one more remark: all of this is only possible because some random people did some things in their free time 😉
so the real credits of SBB should go towards small OpenSource projects and contributors (like you!)


### Example App

Merging a release please PR will open another PR with a commit syncing the example app to the
package version and increasing the build number by one.
The example app release process is initiated by running the `example_app_release_pr` Github action. This will
open a PR with a commit syncing the example app to the package version and increasing the build number by one.

Upon merging this PR, the example app will be released to the enterprise app stores.
Upon merging this PR, the example app will be released to the enterprise app store.

[Release Please]: https://github.com/googleapis/release-please
[Github Action version]: https://github.com/googleapis/release-please-action
Loading