Skip to content

Commit

Permalink
ci: configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jul 3, 2024
1 parent aab77d4 commit 8ec9924
Show file tree
Hide file tree
Showing 10 changed files with 257 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open_collective: react-native-iap
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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**

<!-- A brief description of the issue. -->

**Expected Behavior**

<!-- A brief description of what you expected to happen. -->

**Screenshots**

<!-- Add screenshots, if applicable, to help explain your problem. -->

**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**

<!-- Add any other context about the problem here. -->
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
24 changes: 24 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions .github/workflows/ci-ktlint-android.yml
Original file line number Diff line number Diff line change
@@ -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.
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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

24 changes: 24 additions & 0 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL: 'gpt-4o'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/publish-next.yml
Original file line number Diff line number Diff line change
@@ -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 }}
35 changes: 35 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion ios/ExpoIap.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 8ec9924

Please sign in to comment.