From 3324d4b60aa08bf88622feff516bbd9dce684214 Mon Sep 17 00:00:00 2001 From: hyochan Date: Thu, 4 Jul 2024 01:31:32 +0900 Subject: [PATCH] ci: configs --- .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/bug_report.md | 40 ++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/stale.yml | 24 +++++++++ .github/workflows/ci-ktlint-android.yml | 24 +++++++++ .github/workflows/ci.yml | 71 +++++++++++++++++++++++++ .github/workflows/code-review.yml | 24 +++++++++ .github/workflows/publish-next.yml | 36 +++++++++++++ .github/workflows/publish-package.yml | 35 ++++++++++++ ios/ExpoIap.podspec | 2 +- 10 files changed, 257 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/stale.yml create mode 100644 .github/workflows/ci-ktlint-android.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/code-review.yml create mode 100644 .github/workflows/publish-next.yml create mode 100644 .github/workflows/publish-package.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..d0de4a1 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +open_collective: react-native-iap diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..684e091 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,40 @@ +--- +name: 🐛 Bug Report +about: Report an issue to help us improve expo-iap +title: '' +labels: 'bug' +assignees: '' +--- + +> Please use the [Discussion board](https://github.com/hyochan/expo-iap/discussions) if you want to get some help. Please use issues to report bugs. + +**Description** + + + +**Expected Behavior** + + + +**Screenshots** + + + +**Environment:** + +- expo-iap: +- react-native: +- Platforms (iOS, Android, emulator, simulator, device): + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Press '...' +3. Error '...' is shown + +--- + +[Optional] **Additional Context** + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..1487594 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,24 @@ +# Configuration for probot-stale - https://github.com/probot/stale +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 90 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 30 +# Issues with these labels will never be considered stale +exemptLabels: + - Good first issue + - For Discussion + - Core Team + - "Help Wanted :octocat:" + - ":warning:Regression" + - ":clock1:PR Pending" +# Label to use when marking an issue as stale +staleLabel: Stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. + You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. + Thank you for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: > + Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. +only: issues diff --git a/.github/workflows/ci-ktlint-android.yml b/.github/workflows/ci-ktlint-android.yml new file mode 100644 index 0000000..0342ba5 --- /dev/null +++ b/.github/workflows/ci-ktlint-android.yml @@ -0,0 +1,24 @@ +name: CI / Ktlint Android + +on: + pull_request: + paths: + - .github/workflows/ci-ktlint-android.yml + - 'android/src/**/*.kt' + - '**.kts' + +jobs: + ktlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: | + curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.48.2/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ + - name: run ktlint + run: | + ktlint --reporter=checkstyle,output=build/ktlint-report.xml + continue-on-error: true + - uses: yutailang0119/action-ktlint@v3 + with: + report-path: build/*.xml # Support glob patterns by https://www.npmjs.com/package/@actions/glob + continue-on-error: false # If annotations contain error of severity, action-ktlint exit 1. \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a7afd0c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: CI + +on: + push: + branches: [main, next] + paths: + - 'docs/**' + - 'src/**' + - 'scripts/**' + - 'test/**' + - '*.md' + - '*.json' + - '*.js' + - '*.lock' + - 'IapExample/src/**' + - 'IapExample/*.json' + - 'IapExample/*.js' + - 'IapExample/*.lock' + - 'IapExample/*.tsx' + - .github/** + + pull_request: + types: [opened, synchronize, reopened] + paths: + - 'docs/**' + - 'src/**' + - 'scripts/**' + - 'test/**' + - '*.md' + - '*.json' + - '*.js' + - '*.lock' + - 'IapExample/src/**' + - 'IapExample/*.json' + - 'IapExample/*.js' + - 'IapExample/*.lock' + - 'IapExample/*.tsx' + - .github/** + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: 'yarn' + + - name: Install reviewdog + uses: reviewdog/action-setup@v1 + + - name: Install dependencies + run: yarn install --immutable + + # - name: Install node_modules for `IapExample/` + # run: yarn install --immutable + # working-directory: IapExample + + # - name: Run TypeScript + # run: | + # yarn lint:tsc | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee + # env: + # REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # - name: Run lint scripts + # run: yarn lint:ci + diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml new file mode 100644 index 0000000..9f98d1e --- /dev/null +++ b/.github/workflows/code-review.yml @@ -0,0 +1,24 @@ +name: Code Review GPT + +on: + pull_request: + branches: [main] + +permissions: + pull-requests: write + contents: read + +jobs: + run_code_review: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Code Review GPT + uses: mattzcarey/code-review-gpt@v0.1.8 + with: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + MODEL: 'gpt-4o' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-next.yml b/.github/workflows/publish-next.yml new file mode 100644 index 0000000..a779d3e --- /dev/null +++ b/.github/workflows/publish-next.yml @@ -0,0 +1,36 @@ +name: Publish next package + +on: + release: + types: [created] + +jobs: + deploy: + if: github.event.release.prerelease + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: 'yarn' + registry-url: 'https://registry.npmjs.org' + + - name: Remove example code + run: rm -rf IapExample + + - name: Install dependencies + run: yarn install --immutable + + - name: Build typescript + run: yarn lint:ci + + - name: Verify no files have changed after auto-fix + run: git diff -- ":(exclude)IapExample/*" --exit-code HEAD + + - run: npm publish --tag next + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..0572ac8 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,35 @@ +name: Publish main package + +on: + release: + types: [created] + +jobs: + deploy: + if: '!github.event.release.prerelease' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: 'yarn' + registry-url: 'https://registry.npmjs.org' + + - name: Remove example code + run: rm -rf IapExample + + - name: Install dependencies + run: yarn install --immutable + + - name: Run lint scripts + run: yarn lint:ci + + - name: Verify no files have changed after auto-fix + run: git diff -- ":(exclude)IapExample/*" --exit-code HEAD + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/ios/ExpoIap.podspec b/ios/ExpoIap.podspec index 5f4fcab..610af53 100644 --- a/ios/ExpoIap.podspec +++ b/ios/ExpoIap.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |s| s.homepage = package['homepage'] s.platforms = { :ios => '15.0', :tvos => '15.0' } s.swift_version = '5.4' - s.source = { git: 'https://github.com/dooboolab-community/expo-iap' } + s.source = { git: 'https://github.com/hyochan/expo-iap' } s.static_framework = true s.dependency 'ExpoModulesCore'