diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..53b061a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..cda2415 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,37 @@ +name: Publish to Pub.dev & Github +on: + pull_request: + types: + - closed + branches: + - main + - rel/** + +jobs: + publish: + if: | + 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" + + - name: Publish to Pub.dev + run: | + flutter pub publish + + create-release: + needs: publish + uses: OneSignal/sdk-actions/.github/workflows/github-release.yml@main + with: + version: ${{ needs.publish.outputs.version }}