Skip to content

Commit 1581e27

Browse files
authored
Merge pull request #107 from sentry-demos/antonis/revert-to-244d656
Revert repository to commit 244d656
2 parents a35ff11 + 78964ba commit 1581e27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5298
-7224
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Android
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
description: 'The branch to build from. E.g. main'
8+
required: false
9+
type: string
10+
11+
jobs:
12+
build-android:
13+
name: Android
14+
runs-on: ubuntu-latest
15+
env:
16+
APK_PATH: android/app/build/outputs/apk/release/app-release.apk
17+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
18+
SENTRY_ALLOW_FAILURE: false
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ inputs.ref }}
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 18
27+
cache: 'npm'
28+
cache-dependency-path: package-lock.json
29+
30+
- run: npm ci
31+
32+
- uses: actions/setup-java@v4
33+
with:
34+
java-version: '17'
35+
distribution: 'adopt'
36+
37+
- uses: gradle/gradle-build-action@v3
38+
39+
- working-directory: android
40+
run: ./gradlew :app:assembleRelease
41+
42+
- name: Upload APK
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: empower-plant-react-native-android
46+
path: ${{ env.APK_PATH }}
47+
retention-days: 60

.github/workflows/build-ios.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: iOS
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ref:
7+
description: 'The branch to build from. E.g. main'
8+
required: false
9+
type: string
10+
11+
jobs:
12+
build-ios:
13+
name: iOS
14+
runs-on: macos-14
15+
env:
16+
APP_ARCHIVE_PATH: sentry_react_native.app.zip
17+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
18+
SENTRY_ALLOW_FAILURE: false
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ inputs.ref }}
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 18
27+
cache: 'npm'
28+
cache-dependency-path: package-lock.json
29+
30+
- run: npm ci
31+
32+
- uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: '3.3.0'
35+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
36+
37+
- working-directory: ios
38+
run: bundle exec pod install
39+
40+
- name: Run xcodebuild
41+
working-directory: ios
42+
run: |
43+
mkdir -p "DerivedData"
44+
derivedData="$(cd "DerivedData" ; pwd -P)"
45+
set -o pipefail && xcodebuild \
46+
-workspace sentry_react_native.xcworkspace \
47+
-configuration "Release" \
48+
-scheme sentry_react_native \
49+
-destination 'generic/platform=iOS Simulator' \
50+
-derivedDataPath "$derivedData" \
51+
build \
52+
| tee xcodebuild.log \
53+
| xcbeautify --quieter --is-ci --disable-colored-output
54+
55+
- name: Archive App
56+
run: |
57+
cd ios/DerivedData/Build/Products/Release-iphonesimulator
58+
zip -r \
59+
${{ github.workspace }}/${{ env.APP_ARCHIVE_PATH }} \
60+
sentry_react_native.app
61+
62+
- name: Upload APP
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: empower-plant-react-native-ios
66+
path: ${{ env.APP_ARCHIVE_PATH }}
67+
retention-days: 60
68+
69+
- name: Upload logs
70+
if: ${{ always() }}
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: build-ios-logs
74+
path: ios/xcodebuild.log

.github/workflows/build.yml

Lines changed: 10 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -6,144 +6,22 @@ on:
66
- master
77
pull_request:
88

9-
env:
10-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
11-
SENTRY_ALLOW_FAILURE: false
12-
MAESTRO_VERSION: 1.39.0
13-
149
concurrency:
1510
group: ${{ github.workflow }}-${{ github.ref }}
16-
cancel-in-progress: true
11+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
1712

1813
jobs:
1914
build-android:
20-
name: Android
21-
runs-on: ubuntu-latest
22-
steps:
23-
- uses: actions/checkout@v4
24-
25-
- uses: actions/setup-node@v4
26-
with:
27-
node-version: 18
28-
cache: 'npm'
29-
cache-dependency-path: package-lock.json
30-
31-
- run: npm ci
32-
33-
- uses: actions/setup-java@v4
34-
with:
35-
java-version: '17'
36-
distribution: 'adopt'
37-
38-
- uses: gradle/gradle-build-action@v3
39-
40-
- working-directory: android
41-
run: ./gradlew :app:assembleRelease
42-
43-
- name: Upload APK
44-
uses: actions/upload-artifact@v4
45-
with:
46-
name: empower-plant-react-native-android
47-
path: android/app/build/outputs/apk/release/app-release.apk
48-
retention-days: 60
15+
name: 'Build Android'
16+
uses: ./.github/workflows/build-android.yml
17+
secrets: inherit
4918

5019
build-ios:
51-
name: iOS
52-
runs-on: macos-14
53-
steps:
54-
- uses: actions/checkout@v4
55-
56-
- uses: actions/setup-node@v4
57-
with:
58-
node-version: 18
59-
cache: 'npm'
60-
cache-dependency-path: package-lock.json
61-
62-
- run: npm ci
20+
name: 'Build iOS'
21+
uses: ./.github/workflows/build-ios.yml
22+
secrets: inherit
6323

64-
- uses: ruby/setup-ruby@v1
65-
with:
66-
ruby-version: '3.3.0'
67-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
68-
69-
- working-directory: ios
70-
run: bundle exec pod install
71-
72-
- name: Run xcodebuild
73-
working-directory: ios
74-
run: |
75-
mkdir -p "DerivedData"
76-
derivedData="$(cd "DerivedData" ; pwd -P)"
77-
set -o pipefail && xcodebuild \
78-
-workspace sentry_react_native.xcworkspace \
79-
-configuration "Release" \
80-
-scheme sentry_react_native \
81-
-destination 'generic/platform=iOS Simulator' \
82-
-derivedDataPath "$derivedData" \
83-
build \
84-
| tee xcodebuild.log \
85-
| xcbeautify --quieter --is-ci --disable-colored-output
86-
87-
- name: Upload APP
88-
uses: actions/upload-artifact@v4
89-
with:
90-
name: empower-plant-react-native-ios
91-
path: ios/DerivedData/Build/Products/Release-iphonesimulator/sentry_react_native.app
92-
retention-days: 60
93-
94-
- name: Upload logs
95-
if: ${{ always() }}
96-
uses: actions/upload-artifact@v4
97-
with:
98-
name: build-ios-logs
99-
path: ios/xcodebuild.log
100-
101-
run-ui-test-android:
102-
name: UI Test Android
24+
test:
25+
name: 'Run UI Tests'
10326
needs: build-android
104-
runs-on: ubuntu-latest
105-
steps:
106-
- uses: actions/checkout@v4
107-
108-
- name: Setup KVM
109-
shell: bash
110-
run: |
111-
# check if virtualization is supported...
112-
sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
113-
# allow access to KVM to run the emulator
114-
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
115-
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
116-
sudo udevadm control --reload-rules
117-
sudo udevadm trigger --name-match=kvm
118-
119-
- name: Download APK artifact
120-
uses: actions/download-artifact@v4
121-
with:
122-
name: empower-plant-react-native-android
123-
124-
- name: Install Maestro
125-
uses: dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # [email protected]
126-
with:
127-
maestro-version: ${{env.MAESTRO_VERSION}}
128-
129-
- name: Run tests
130-
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # [email protected]
131-
with:
132-
api-level: 30
133-
force-avd-creation: false
134-
disable-animations: true
135-
disable-spellchecker: true
136-
target: 'aosp_atd'
137-
channel: canary # Necessary for ATDs
138-
emulator-options: >
139-
-no-window
140-
-no-snapshot-save
141-
-gpu swiftshader_indirect
142-
-noaudio
143-
-no-boot-anim
144-
-camera-back none
145-
-camera-front none
146-
-timezone US/Pacific
147-
script: |
148-
adb install -r -d app-release.apk
149-
maestro test maestro --debug-output maestro-logs --env=APP_ID=com.sentry_react_native
27+
uses: ./.github/workflows/test.yml

.github/workflows/release.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'The version name to release. E.g. 4.0.2'
7+
required: true
8+
9+
env:
10+
APK_PATH: app-release.apk
11+
APP_ARCHIVE_PATH: sentry_react_native.app.zip
12+
GH_TOKEN: ${{ github.token }}
13+
14+
jobs:
15+
bump-version:
16+
runs-on: ubuntu-latest
17+
name: 'Prepare Release'
18+
steps:
19+
- name: Set environment variables
20+
run: |
21+
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
22+
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 18
28+
cache: 'npm'
29+
cache-dependency-path: package-lock.json
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Bump Version
35+
run: |
36+
git config user.name getsentry-bot
37+
git config user.email [email protected]
38+
39+
git checkout -b release/${{ env.VERSION }}
40+
npm version ${{ env.VERSION }}
41+
git tag --force ${{ env.VERSION }} -m ${{ env.VERSION }}
42+
git push origin ${{ env.VERSION }}
43+
git push origin release/${{ env.VERSION }}
44+
45+
build-android:
46+
name: 'Build Android'
47+
needs: [bump-version]
48+
uses: ./.github/workflows/build-android.yml
49+
secrets: inherit
50+
with:
51+
ref: release/${{ inputs.version }}
52+
53+
build-ios:
54+
name: 'Build iOS'
55+
needs: [bump-version]
56+
uses: ./.github/workflows/build-ios.yml
57+
secrets: inherit
58+
with:
59+
ref: release/${{ inputs.version }}
60+
61+
publish-release:
62+
name: 'Publish Release'
63+
needs: [bump-version, build-android, build-ios]
64+
runs-on: ubuntu-latest
65+
env:
66+
MERGE_TARGET: master
67+
steps:
68+
- name: Set environment variables
69+
run: |
70+
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
71+
72+
- uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0 # fetch all history all branches and tags
75+
76+
- name: Download iOS App
77+
uses: actions/download-artifact@v4
78+
with:
79+
name: empower-plant-react-native-ios
80+
81+
- name: Download Android APK
82+
uses: actions/download-artifact@v4
83+
with:
84+
name: empower-plant-react-native-android
85+
86+
- name: Set GitHub user
87+
run: |
88+
git config user.name getsentry-bot
89+
git config user.email [email protected]
90+
91+
- name: Create Release
92+
run: |
93+
gh release create \
94+
${{ env.VERSION }} \
95+
${{ env.APK_PATH }} \
96+
${{ env.APP_ARCHIVE_PATH }} \
97+
--title ${{ env.VERSION }} \
98+
--notes "Release ${{ env.VERSION }}" \
99+
|| error_exit "Failed to create GitHub release."
100+
101+
- name: Clean up Release Branch
102+
run: |
103+
git reset --hard
104+
git checkout ${{ env.MERGE_TARGET }}
105+
git push origin --delete release/${{ env.VERSION }}

0 commit comments

Comments
 (0)