-
Notifications
You must be signed in to change notification settings - Fork 236
39 lines (36 loc) · 1.09 KB
/
cd.yml
File metadata and controls
39 lines (36 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# For Flutter publish, a tag must be created first so we create a Github Release
# Then this should trigger the publish to Pub.dev workflow
name: Publish to Github
on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- main
- rel/**
jobs:
publish:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.merged == true &&
contains(github.event.pull_request.title, 'chore: Release'))
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Get version from pubspec.yaml
id: version
run: |
VERSION=$(grep "^version:" pubspec.yaml | sed 's/version: //' | tr -d ' ')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
create-release:
needs: publish
uses: OneSignal/sdk-shared/.github/workflows/github-release.yml@main
secrets:
GH_PUSH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
with:
version: ${{ needs.publish.outputs.version }}