Skip to content

Commit 160efaa

Browse files
authored
ci: add deployment worfklow (#1071)
1 parent 9e4caa5 commit 160efaa

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.github/workflows/cd.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to Pub.dev & Github
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
branches:
7+
- main
8+
- rel/**
9+
10+
jobs:
11+
publish:
12+
if: |
13+
github.event.pull_request.merged == true &&
14+
contains(github.event.pull_request.title, 'chore: Release')
15+
runs-on: ubuntu-latest
16+
outputs:
17+
version: ${{ steps.version.outputs.version }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
21+
22+
- name: Get version from pubspec.yaml
23+
id: version
24+
run: |
25+
VERSION=$(grep "^version:" pubspec.yaml | sed 's/version: //' | tr -d ' ')
26+
echo "version=$VERSION" >> $GITHUB_OUTPUT
27+
echo "Version: $VERSION"
28+
29+
- name: Publish to Pub.dev
30+
run: |
31+
flutter pub publish
32+
33+
create-release:
34+
needs: publish
35+
uses: OneSignal/sdk-actions/.github/workflows/github-release.yml@main
36+
with:
37+
version: ${{ needs.publish.outputs.version }}

0 commit comments

Comments
 (0)