Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 2de76d0

Browse files
authored
ci: add publish workflow (#117)
* ci: add GitHub Actions workflow for automated release pull requests * ci: update release workflow to support optional package selection and improved PR creation * ci: add GitHub Actions workflow for publishing packages to pub.dev * ci: remove create release pull request workflow * docs: update release procedures in README to reflect automation with GitHub Actions
1 parent 7e7e79e commit 2de76d0

File tree

2 files changed

+55
-8
lines changed

2 files changed

+55
-8
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to pub.dev
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
publish:
12+
name: Publish Packages
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 60
15+
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/'))
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Dart
20+
uses: dart-lang/setup-dart@v1
21+
22+
- name: Install Melos
23+
run: dart pub global activate melos
24+
25+
- name: Bootstrap Melos
26+
run: melos bootstrap
27+
28+
- name: Publish to pub.dev
29+
env:
30+
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
31+
run: |
32+
echo "$PUB_CREDENTIALS" > "$HOME/.config/dart/pub-credentials.json"
33+
melos publish --no-dry-run --yes

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
# Development
22

3-
## Release procedures for a altfire package.
3+
## Release procedures for an altfire package
44

5-
1. Create a branch for release.
6-
1. Run the `melos version` command.
7-
1. Run the `git push origin release --follow-tags` command. Push the changes and the created tags.
8-
1. Create a pull request for the pushed branch.
9-
1. Merge the pull request after review.
10-
1. Run the `melos publish` command on the `main` branch.
5+
Releases are now automated using GitHub Actions. To create a release, follow these steps:
6+
7+
1. Trigger the **Create Release Pull Request** workflow manually from GitHub Actions.
8+
- If needed, select the package to release.
9+
- If no package is selected, all modified packages will be included.
10+
2. Review the automatically generated release pull request and merge it after approval.
11+
3. Once the pull request is merged into `main`, the **Publish to pub.dev** workflow will be triggered automatically to publish the updated packages.
12+
13+
### Manual release (if needed)
14+
15+
<details>
16+
<summary>Click to expand manual release steps</summary>
17+
18+
1. Create a branch for the release.
19+
2. Run the `melos version` command.
20+
3. Run `git push origin release --follow-tags` to push the changes and tags.
21+
4. Create a pull request for the pushed branch.
22+
5. Merge the pull request after review.
23+
6. Run the `melos publish` command on the `main` branch.
1124

1225
```shell
1326
# Narrow down the target package as needed.
@@ -20,6 +33,7 @@ melos version \
2033
--manual-version altfire_messenger:0.2.1 \
2134
--manual-version altfire_tracker:0.1.5 \
2235
```
36+
</details>
2337

2438
## Add new example package
2539

@@ -35,7 +49,7 @@ packages/${PACKAGE_NAME}/example
3549
```shell
3650
flutter pub add firebase_core \
3751
'${PACKAGE_NAME}:{"path":"../"}' \
38-
dev:altive_lints
52+
dev:altive_lints
3953
```
4054

4155
### Configure FlutterFire

0 commit comments

Comments
 (0)