From f70e1cc7cc46259a36fcc4c373c2a9597aa7d1d1 Mon Sep 17 00:00:00 2001 From: ryanhanks-bestow Date: Sat, 27 Jan 2024 03:03:56 -0600 Subject: [PATCH] feat: add workflows --- .github/workflows/analyze.yaml | 14 +++++++++++ .github/workflows/format.yaml | 14 +++++++++++ .github/workflows/publish.yaml | 10 ++++++++ .github/workflows/release-please.yaml | 26 ++++++++++++++++++++ .github/workflows/semantic-pull-request.yaml | 20 +++++++++++++++ .github/workflows/test.yaml | 22 +++++++++++++++++ 6 files changed, 106 insertions(+) create mode 100644 .github/workflows/analyze.yaml create mode 100644 .github/workflows/format.yaml create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/release-please.yaml create mode 100644 .github/workflows/semantic-pull-request.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml new file mode 100644 index 0000000..23dad32 --- /dev/null +++ b/.github/workflows/analyze.yaml @@ -0,0 +1,14 @@ +name: analyze +on: + pull_request: +permissions: + pull-requests: read +jobs: + analyze: + runs-on: ubuntu-latest + steps: + - run: echo noop +# - uses: actions/checkout@v4.1.1 +# - uses: dart-lang/setup-dart@v1 +# - run: dart pub get +# - run: dart analyze . diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..d9bfdd6 --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,14 @@ +name: format +on: + pull_request: +permissions: + pull-requests: read +jobs: + format: + runs-on: ubuntu-latest + steps: + - run: echo noop +# - uses: actions/checkout@v4.1.1 +# - uses: dart-lang/setup-dart@v1 +# - run: dart pub get +# - run: dart format --set-exit-if-changed . diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..fa71911 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,10 @@ +name: Publish to pub.dev +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' +jobs: + publish: + permissions: + id-token: write + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..61247f0 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,26 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - uses: google-github-actions/release-please-action@v4 + id: release + with: + token: $ + release-type: dart + - name: Enable Pull Request Automerge + if: steps.release.outputs.prs_created && steps.release.outputs.pr != null + run: gh pr merge --merge --auto $ + env: + GH_TOKEN: $ diff --git a/.github/workflows/semantic-pull-request.yaml b/.github/workflows/semantic-pull-request.yaml new file mode 100644 index 0000000..1a5d8d8 --- /dev/null +++ b/.github/workflows/semantic-pull-request.yaml @@ -0,0 +1,20 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + semantic-pull-request: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: $ diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..007f609 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,22 @@ +name: test +on: + pull_request: +permissions: + pull-requests: read +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: echo noop +# - uses: actions/checkout@v4.1.1 +# - uses: dart-lang/setup-dart@v1 +# - run: dart pub get +# - id: check-test-dependency +# run: | +# if grep -q 'test:' pubspec.yaml; then +# echo "test_dependency=true" >> $GITHUB_ENV +# else +# echo "test_dependency=false" >> $GITHUB_ENV +# fi +# - if: env.test_dependency == 'true' +# run: dart test