refactor: Adapt to new repository
This commit is contained in:
@@ -42,7 +42,7 @@ def check_changelog
|
||||
|
||||
# Now, check that links [#nn](.../nn) have matching numbers in link title & URL
|
||||
wrong_links = line.scan(links).reject do |m|
|
||||
slug = m[0] || "stencilproject/#{current_repo}"
|
||||
slug = m[0] || "stencilproject/Stencil"
|
||||
(slug == m[2]) && (m[1] == m[4])
|
||||
end
|
||||
all_warnings.concat Array(wrong_links.map do |m|
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@
|
||||
|
||||
namespace :lint do
|
||||
SWIFTLINT = 'rakelib/lint.sh'
|
||||
SWIFTLINT_VERSION = '0.48.0'
|
||||
SWIFTLINT_VERSION = '0.61.0'
|
||||
|
||||
task :install do |task|
|
||||
task :install do |task|
|
||||
next if check_version
|
||||
|
||||
if OS.mac?
|
||||
|
||||
+5
-15
@@ -7,7 +7,7 @@ require 'json'
|
||||
|
||||
namespace :release do
|
||||
desc 'Create a new release'
|
||||
task :new => [:check_versions, :check_tag_and_ask_to_release, 'spm:test', :github, :cocoapods]
|
||||
task :new => [:check_versions, :check_tag_and_ask_to_release, 'spm:test', :github]
|
||||
|
||||
desc 'Check if all versions from the podspecs and CHANGELOG match'
|
||||
task :check_versions do
|
||||
@@ -15,7 +15,7 @@ namespace :release do
|
||||
|
||||
Utils.table_header('Check', 'Status')
|
||||
|
||||
# Check if bundler is installed first, as we'll need it for the cocoapods task (and we prefer to fail early)
|
||||
# Check if bundler is installed first (we prefer to fail early)
|
||||
`which bundler`
|
||||
results << Utils.table_result(
|
||||
$CHILD_STATUS.success?,
|
||||
@@ -40,18 +40,14 @@ namespace :release do
|
||||
|
||||
# Check docs installation
|
||||
docs_package = Utils.first_match_in_file('docs/installation.rst', /\.package\(url: .+ from: "(.+)"/, 1)
|
||||
docs_cocoapods = Utils.first_match_in_file('docs/installation.rst', /pod 'Stencil', '~> (.+)'/, 1)
|
||||
docs_carthage = Utils.first_match_in_file('docs/installation.rst', /github ".+\/Stencil" ~> (.+)/, 1)
|
||||
results << Utils.table_result(docs_package == v, 'Docs, package updated', 'Update the package version in docs/installation.rst')
|
||||
results << Utils.table_result(docs_cocoapods == v, 'Docs, cocoapods updated', 'Update the cocoapods version in docs/installation.rst')
|
||||
results << Utils.table_result(docs_carthage == v, 'Docs, carthage updated', 'Update the carthage version in docs/installation.rst')
|
||||
|
||||
# Check if entry present in CHANGELOG
|
||||
changelog_entry = Utils.first_match_in_file('CHANGELOG.md', /^## #{Regexp.quote(v)}$/)
|
||||
results << Utils.table_result(changelog_entry, 'CHANGELOG, Entry added', "Add an entry for #{v} in CHANGELOG.md")
|
||||
|
||||
changelog_has_stable = system("grep -qi '^## Master' CHANGELOG.md")
|
||||
results << Utils.table_result(!changelog_has_stable, 'CHANGELOG, No master', 'Remove section for master branch in CHANGELOG')
|
||||
results << Utils.table_result(!changelog_has_stable, 'CHANGELOG, No master', 'Remove section for main branch in CHANGELOG')
|
||||
|
||||
exit 1 unless results.all?
|
||||
end
|
||||
@@ -82,16 +78,10 @@ namespace :release do
|
||||
tag = Utils.top_changelog_version
|
||||
body = Utils.top_changelog_entry
|
||||
|
||||
raise 'Must be a valid version' if tag == 'Master'
|
||||
raise 'Must be a valid version' if tag == 'main'
|
||||
|
||||
repo_name = File.basename(`git remote get-url origin`.chomp, '.git').freeze
|
||||
puts "Pushing release notes for tag #{tag}"
|
||||
client.create_release("stencilproject/#{repo_name}", tag, name: tag, body: body)
|
||||
end
|
||||
|
||||
desc "pod trunk push #{POD_NAME} to CocoaPods"
|
||||
task :cocoapods do
|
||||
Utils.print_header 'Pushing pod to CocoaPods Trunk'
|
||||
sh "bundle exec pod trunk push #{POD_NAME}.podspec.json"
|
||||
client.create_release("swiftstencil/#{repo_name}", tag, name: tag, body: body)
|
||||
end
|
||||
end
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ class Utils
|
||||
def self.spm_own_version(dep)
|
||||
dependencies = JSON.load(File.new('Package.resolved'))['object']['pins']
|
||||
dependencies.find { |d| d['package'] == dep }['state']['version']
|
||||
end
|
||||
end
|
||||
|
||||
def self.spm_resolved_version(dep)
|
||||
dependencies = JSON.load(File.new('Package.resolved'))['object']['pins']
|
||||
|
||||
Reference in New Issue
Block a user