Skip to content

Commit 2b87395

Browse files
committed
chore(ci): imporve ci
1 parent aa16a1a commit 2b87395

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
build_android:
3131
runs-on: ubuntu-latest
3232
permissions:
33-
contents: 'read' # Allows workflow to checkout repository code
33+
contents: 'write' # Allows workflow to checkout repository code
3434
id-token: 'write' # Required for Google Cloud Workload Identity Federation authentication (OIDC token generation)
3535

3636
steps:
@@ -67,9 +67,11 @@ jobs:
6767
run: |
6868
git config user.name "GitHub Actions"
6969
git config user.email "[email protected]"
70-
git add .
70+
git add .version package.json android/app/build.gradle ios/**/Info.plist
7171
git commit -m "Bump version to $(cat .version)"
7272
git push
73+
git tag "v$(cat .version)"
74+
git push origin "v$(cat .version)"
7375
7476
# Step 7: Set up Android Keystore
7577
- name: Set up Android Keystore
@@ -94,25 +96,31 @@ jobs:
9496
run: bundle exec fastlane release_android_alpha
9597

9698
# Step 10: Upload the entire project directory for use in the iOS job
97-
- name: Upload code for iOS build
98-
uses: actions/upload-artifact@v3
99-
with:
100-
name: source-code
101-
path: .
102-
retention-days: 1
99+
# - name: Upload code for iOS build
100+
# uses: actions/upload-artifact@v3
101+
# with:
102+
# name: source-code
103+
# path: .
104+
# retention-days: 1
103105

104106
# Job 2: iOS Build and Upload (runs on macOS)
105107
build_ios:
106108
runs-on: macos-latest
107109
needs: build_android
108110

109111
steps:
110-
# Step 1: Download code from previous job
111-
- name: Download code
112-
uses: actions/download-artifact@v3
112+
- name: Checkout code # Replace the Download code step
113+
uses: actions/checkout@v3
113114
with:
114-
name: source-code
115-
path: .
115+
ref: ${{ github.ref }} # This ensures we get the latest changes including the version bump
116+
117+
# steps:
118+
# # Step 1: Download code from previous job
119+
# - name: Download code
120+
# uses: actions/download-artifact@v3
121+
# with:
122+
# name: source-code
123+
# path: .
116124

117125
# Step 2: Set up Node.js
118126
- name: Set up Node.js

fastlane/Fastfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ lane :bump_version do |options|
44

55
# Bump version in package.json using Yarn
66
begin
7-
output = sh("yarn version --#{version_type} --no-git-tag-version")
8-
new_version = output.match(/New version: (.+)$/)[1]
7+
sh("yarn version --#{version_type} --no-git-tag-version")
8+
new_version = JSON.parse(File.read('package.json'))['version']
99
sh("echo #{new_version} > .version")
1010
rescue => e
11-
UI.error("Failed to bump version: #{e.message}")
12-
raise
11+
UI.user_error!("Failed to bump version: #{e.message}")
1312
end
1413

1514
# Bump iOS version

0 commit comments

Comments
 (0)