From 148fe3f8776e2a79fce656024e1af7549bb87088 Mon Sep 17 00:00:00 2001 From: Alexey Korolev Date: Fri, 8 Nov 2024 09:28:07 +0300 Subject: [PATCH] Edit github actions --- .github/workflows/generate.yml | 10 ++++------ hooks/post_gen_project.sh | 14 ++++++-------- {{ cookiecutter.name }}/.mise.toml | 7 ++++--- {{ cookiecutter.name }}/.ruby-version | 1 - {{ cookiecutter.name }}/Gemfile | 3 --- {{ cookiecutter.name }}/project.yml | 1 - 6 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 {{ cookiecutter.name }}/.ruby-version delete mode 100644 {{ cookiecutter.name }}/Gemfile diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index cb9be4f..bf0cf53 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -5,18 +5,16 @@ on: [push] jobs: test: runs-on: macos-14 - env: - MINT_PATH: "~/mint_cache" steps: - uses: actions/checkout@v1 - name: Generate project and run tests run: | - export PATH=~/.rbenv/shims:"$PATH" - - brew install cookiecutter rbenv mint fastlane && - rbenv install 3.0.6 && + brew install cookiecutter mise fastlane && + mise settings set experimental true && + mise activate --shims && cookiecutter --no-input -f . && cd Project && + mise install && fastlane scan diff --git a/hooks/post_gen_project.sh b/hooks/post_gen_project.sh index 3480ede..79cac0a 100755 --- a/hooks/post_gen_project.sh +++ b/hooks/post_gen_project.sh @@ -1,20 +1,18 @@ #!/bin/sh +# Install all dependencies +mise install + # Generate xcodeproj file -make project +mise exec -- xcodegen # Download .gitignore file curl -L 'https://www.gitignore.io/api/swift,macos,fastlane' > .gitignore -echo '.cache' >> .gitignore {% if cookiecutter.ignore_xcproject == "Yes" %} echo '{{ cookiecutter.name }}.xcodeproj' >> .gitignore - echo '{{ cookiecutter.name }}.xcworkspace' >> .gitignore {% endif %} -echo 'Pods' >> .gitignore - -make fmt -make gems +mise run fmt # Stamp current version of xcode in .xcode-version file xcodebuild -version | sed 's/Xcode //' | head -n 1 > .xcode-version @@ -23,4 +21,4 @@ git init git add . git commit -m "Initial commit" -mise generate pre-commit +mise generate git-pre-commit --write diff --git a/{{ cookiecutter.name }}/.mise.toml b/{{ cookiecutter.name }}/.mise.toml index efd139c..96e008d 100644 --- a/{{ cookiecutter.name }}/.mise.toml +++ b/{{ cookiecutter.name }}/.mise.toml @@ -1,7 +1,8 @@ [tasks] -lint = "swiftformat GrowFood --lint" -fmt = "swiftformat GrowFood" +pre-commit = "swiftformat {{ cookiecutter.name }} {{ cookiecutter.name }}Tests --lint" +fmt = "swiftformat {{ cookiecutter.name }} {{ cookiecutter.name }}Tests" [tools] xcodes = "1.5.0" -"spm:nicklockwood/SwiftFormat" = "0.54.6" +swiftformat = "0.54.6" +xcodegen = "latest" diff --git a/{{ cookiecutter.name }}/.ruby-version b/{{ cookiecutter.name }}/.ruby-version deleted file mode 100644 index 818bd47..0000000 --- a/{{ cookiecutter.name }}/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.0.6 diff --git a/{{ cookiecutter.name }}/Gemfile b/{{ cookiecutter.name }}/Gemfile deleted file mode 100644 index d45950f..0000000 --- a/{{ cookiecutter.name }}/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'cocoapods', '~> 1.15.0' diff --git a/{{ cookiecutter.name }}/project.yml b/{{ cookiecutter.name }}/project.yml index cd637df..28f4b06 100644 --- a/{{ cookiecutter.name }}/project.yml +++ b/{{ cookiecutter.name }}/project.yml @@ -1,6 +1,5 @@ name: {{ cookiecutter.name }} options: - postGenCommand: "make pods" deploymentTarget: iOS: {{ cookiecutter.deployment_target }} developmentLanguage: ru