Skip to content

Commit

Permalink
[316] Use build number from github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarss authored and ducnimble committed Apr 19, 2023
1 parent 80201da commit 393c0da
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy_app_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ jobs:
run: bundle exec pod install
shell: bash

- uses: yanamura/ios-bump-version@v1
with:
build-number: ${{github.run_number}}

- name: Build and Test
run: bundle exec fastlane buildAndTest

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy_production_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ jobs:
run: bundle exec pod install
shell: bash

- uses: yanamura/ios-bump-version@v1
with:
build-number: ${{github.run_number}}

- name: Build and Test
run: bundle exec fastlane buildAndTest

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy_staging_firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
run: bundle exec pod install
shell: bash

- uses: yanamura/ios-bump-version@v1
with:
build-number: ${{github.run_number}}

- name: Build and Test
run: bundle exec fastlane buildAndTest

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_upload_build_to_test_flight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ jobs:
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }}

- uses: yanamura/ios-bump-version@v1
with:
build-number: ${{github.run_number}}

- name: Build App and Distribute to AppStore
run: bundle exec fastlane buildAndUploadToAppStore
env:
Expand Down
50 changes: 25 additions & 25 deletions fastlane/Fastfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Fastfile: LaneFile {
desc("Build Staging app and upload to Firebase")

setAppVersion()
bumpBuild()
// bumpBuild()

buildAdHocStagingLane()

Expand All @@ -83,7 +83,7 @@ class Fastfile: LaneFile {
desc("Build Staging app and upload to Firebase")

setAppVersion()
bumpBuild()
// bumpBuild()

buildAdHocProductionLane()

Expand All @@ -100,11 +100,11 @@ class Fastfile: LaneFile {

setAppVersion()
AppStoreAuthentication.connectAPIKey()
if Secret.bumpAppStoreBuildNumber {
bumpAppstoreBuild()
} else {
bumpBuild()
}
// if Secret.bumpAppStoreBuildNumber {
// bumpAppstoreBuild()
// } else {
// bumpBuild()
// }

buildAppStoreLane()

Expand All @@ -119,7 +119,7 @@ class Fastfile: LaneFile {
desc("Build Production app and upload to TestFlight")

setAppVersion()
bumpBuild()
// bumpBuild()

buildAppStoreLane()

Expand Down Expand Up @@ -197,21 +197,21 @@ class Fastfile: LaneFile {
)
}

private func bumpBuild(buildNumber: Int = numberOfCommits()) {
desc("Set build number with number of commits")
incrementBuildNumber(
buildNumber: .userDefined(String(buildNumber)),
xcodeproj: .userDefined(Constant.projectPath)
)
}

private func bumpAppstoreBuild() {
desc("Set build number with App Store latest build")
let theLatestBuildNumber = latestTestflightBuildNumber(
appIdentifier: Constant.productionBundleId
) + 1
incrementBuildNumber(
buildNumber: .userDefined("\(theLatestBuildNumber)")
)
}
// private func bumpBuild(buildNumber: Int = numberOfCommits()) {
// desc("Set build number with number of commits")
// incrementBuildNumber(
// buildNumber: .userDefined(String(buildNumber)),
// xcodeproj: .userDefined(Constant.projectPath)
// )
// }
//
// private func bumpAppstoreBuild() {
// desc("Set build number with App Store latest build")
// let theLatestBuildNumber = latestTestflightBuildNumber(
// appIdentifier: Constant.productionBundleId
// ) + 1
// incrementBuildNumber(
// buildNumber: .userDefined("\(theLatestBuildNumber)")
// )
// }
}

0 comments on commit 393c0da

Please sign in to comment.