Skip to content

Commit

Permalink
fix: FFS... this is just getting ridiculous. Finally found an issue t…
Browse files Browse the repository at this point in the history
…hread regarding this problem: actions/runner-images#7522 apparently running the process as root is one path to a fix. Reverted from e9f03d2 to HEAD.
  • Loading branch information
othyn committed Jul 14, 2023
1 parent c16c7e3 commit bd268a1
Show file tree
Hide file tree
Showing 6 changed files with 1,186 additions and 31 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ jobs:
ruby-version: '3.0'
bundler-cache: true

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

- name: Install create-dmg (Yarn install)
run: yarn install

- name: Fastlane Build - Beta
if: github.ref == 'refs/heads/staging'
uses: maierj/[email protected]
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-dmg (1.0.1)
fastlane-plugin-find_replace_string (0.1.0)
fastlane-plugin-semantic_release (1.18.2)
fastlane-plugin-versioning (0.5.1)
Expand Down Expand Up @@ -220,7 +219,6 @@ PLATFORMS

DEPENDENCIES
fastlane
fastlane-plugin-dmg
fastlane-plugin-find_replace_string
fastlane-plugin-semantic_release
fastlane-plugin-versioning
Expand Down
62 changes: 34 additions & 28 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ platform :mac do
export_method: "mac-application"
)

# https://github.com/advoryanskiy/fastlane-plugin-dmg
dmg(path: "../macos-auto-clicker/build/AutoClicker.app",
output_path: "../build/AutoClicker.dmg",
volume_name: "AutoClicker",
filesystem: "hfs+",
format: "udzo",
create_applications_symlink: true,
size: 10)
# https://docs.fastlane.tools/actions/sh/#sh
# https://docs.fastlane.tools/advanced/fastlane/#directory-behavior
sh "sudo ../node_modules/.bin/create-dmg ../build/AutoClicker.app --overwrite ../build", log: true, error_callback: -> (result) {
# As the code signing will fail, it will respond with an exit code of 2 instead of a success of 0,
# which fastlane will flag as an error. However if the DMG fails to build, it will be an exit code of 1.
# It would be great if I could check the exit code and only flag as no error if the exit code is 2,
# but this does not appear to be possible
print(result)
error_occurred = false
}
end

lane :beta do
Expand Down Expand Up @@ -58,7 +60,7 @@ platform :mac do
commit_version_bump(
message: "chore: Fastlane automated version bump (beta)",
xcodeproj: "auto-clicker.xcodeproj",
include: %w[Gemfile.lock]
include: %w[Gemfile.lock yarn.lock]
)

# https://docs.fastlane.tools/actions/push_to_git_remote/#push_to_git_remote
Expand Down Expand Up @@ -92,14 +94,16 @@ platform :mac do
}
)

# https://github.com/advoryanskiy/fastlane-plugin-dmg
dmg(path: "../macos-auto-clicker/build/AutoClicker.app",
output_path: "../build/AutoClicker.dmg",
volume_name: "AutoClicker",
filesystem: "hfs+",
format: "udzo",
create_applications_symlink: true,
size: 10)
# https://docs.fastlane.tools/actions/sh/#sh
# https://docs.fastlane.tools/advanced/fastlane/#directory-behavior
sh "sudo ../node_modules/.bin/create-dmg ../build/AutoClicker.app --overwrite ../build", log: true, error_callback: -> (result) {
# As the code signing will fail, it will respond with an exit code of 2 instead of a success of 0,
# which fastlane will flag as an error. However if the DMG fails to build, it will be an exit code of 1.
# It would be great if I could check the exit code and only flag as no error if the exit code is 2,
# but this does not appear to be possible
print(result)
error_occurred = false
}

# https://docs.fastlane.tools/actions/set_github_release/#set_github_release
set_github_release(
Expand All @@ -111,7 +115,7 @@ platform :mac do
is_prerelease: true,
commitish: "main",
upload_assets: [
"build/AutoClicker.dmg",
"build/AutoClicker v#{lane_context[SharedValues::RELEASE_NEXT_VERSION]}-beta-#{lane_context[SharedValues::RELEASE_LAST_TAG_HASH]}.dmg",
"build/AutoClicker.app.dSYM.zip"
]
)
Expand Down Expand Up @@ -160,7 +164,7 @@ platform :mac do
commit_version_bump(
message: "chore: Fastlane automated version bump",
xcodeproj: "auto-clicker.xcodeproj",
include: %w[Gemfile.lock README.md]
include: %w[Gemfile.lock yarn.lock README.md]
)

# https://docs.fastlane.tools/actions/push_to_git_remote/#push_to_git_remote
Expand Down Expand Up @@ -194,14 +198,16 @@ platform :mac do
}
)

# https://github.com/advoryanskiy/fastlane-plugin-dmg
dmg(path: "../macos-auto-clicker/build/AutoClicker.app",
output_path: "../build/AutoClicker.dmg",
volume_name: "AutoClicker",
filesystem: "hfs+",
format: "udzo",
create_applications_symlink: true,
size: 10)
# https://docs.fastlane.tools/actions/sh/#sh
# https://docs.fastlane.tools/advanced/fastlane/#directory-behavior
sh "sudo ../node_modules/.bin/create-dmg ../build/AutoClicker.app --overwrite ../build", log: true, error_callback: -> (result) {
# As the code signing will fail, it will respond with an exit code of 2 instead of a success of 0,
# which fastlane will flag as an error. However if the DMG fails to build, it will be an exit code of 1.
# It would be great if I could check the exit code and only flag as no error if the exit code is 2,
# but this does not appear to be possible
print(result)
error_occurred = false
}

# https://docs.fastlane.tools/actions/set_github_release/#set_github_release
set_github_release(
Expand All @@ -212,7 +218,7 @@ platform :mac do
description: notes,
commitish: "main",
upload_assets: [
"build/AutoClicker.dmg",
"build/AutoClicker #{lane_context[SharedValues::RELEASE_NEXT_VERSION]}.dmg",
"build/AutoClicker.app.dSYM.zip"
]
)
Expand Down
1 change: 0 additions & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
gem 'fastlane-plugin-semantic_release'
gem 'fastlane-plugin-versioning'
gem 'fastlane-plugin-find_replace_string'
gem 'fastlane-plugin-dmg'
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"create-dmg": "^6.0.0"
}
}
Loading

0 comments on commit bd268a1

Please sign in to comment.