-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into brrygrdn/add-support-for-update-types
- Loading branch information
Showing
113 changed files
with
3,216 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,6 @@ | |
|
||
"L: terraform": | ||
- terraform/**/* | ||
|
||
"L: swift": | ||
- swift/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Dependabot | ||
VERSION = "0.221.0" | ||
VERSION = "0.222.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.bundle/ | ||
/.env | ||
/tmp | ||
/dependabot-*.gem | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
inherit_from: ../omnibus/.rubocop.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM ghcr.io/dependabot/dependabot-updater-core | ||
ARG TARGETARCH | ||
|
||
ENV PATH="${PATH}:/opt/swift/usr/bin" | ||
|
||
# OS dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
binutils \ | ||
libc6-dev \ | ||
libcurl4 \ | ||
libedit2 \ | ||
libgcc-9-dev \ | ||
libpython2.7 \ | ||
libsqlite3-0 \ | ||
libstdc++-9-dev \ | ||
libxml2 \ | ||
libz3-dev \ | ||
pkg-config \ | ||
tzdata \ | ||
uuid-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
USER dependabot | ||
|
||
# https://www.swift.org/download/ | ||
ARG SWIFT_VERSION=5.8.1 | ||
ARG SWIFT_UBUNTU_VERSION=ubuntu20.04 | ||
|
||
RUN if [ "$TARGETARCH" = "arm64" ]; then SWIFT_UBUNTU_VERSION="${SWIFT_UBUNTU_VERSION}-aarch64"; fi \ | ||
&& SWIFT_SHORT_UBUNTU_VERSION=$(echo $SWIFT_UBUNTU_VERSION | tr -d .) \ | ||
&& SWIFT_TARBALL="swift-${SWIFT_VERSION}-RELEASE-${SWIFT_UBUNTU_VERSION}.tar.gz" \ | ||
&& DOWNLOAD_URL=https://download.swift.org/swift-${SWIFT_VERSION}-release/${SWIFT_SHORT_UBUNTU_VERSION}/swift-${SWIFT_VERSION}-RELEASE/${SWIFT_TARBALL} \ | ||
&& curl --connect-timeout 15 --retry 5 "${DOWNLOAD_URL}" > "/tmp/${SWIFT_TARBALL}" \ | ||
&& curl --connect-timeout 15 --retry 5 "${DOWNLOAD_URL}.sig" > "/tmp/${SWIFT_TARBALL}.sig" \ | ||
&& sh -c 'curl --connect-timeout 15 --retry 5 https://www.swift.org/keys/all-keys.asc | gpg --import -' \ | ||
&& gpg --keyserver hkp://keyserver.ubuntu.com --refresh-keys Swift \ | ||
&& gpg --verify /tmp/${SWIFT_TARBALL}.sig \ | ||
&& mkdir /opt/swift \ | ||
&& tar -C /opt/swift -xzf /tmp/${SWIFT_TARBALL} --strip-components 1 | ||
|
||
COPY --chown=dependabot:dependabot swift $DEPENDABOT_HOME/swift | ||
COPY --chown=dependabot:dependabot common $DEPENDABOT_HOME/common | ||
COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "dependabot-common", path: "../common" | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## `dependabot-swift` | ||
|
||
Swift Package Manager support for [`dependabot-core`][core-repo]. | ||
|
||
### Running locally | ||
|
||
1. Start a development shell | ||
|
||
``` | ||
$ bin/docker-dev-shell swift | ||
``` | ||
|
||
2. Run tests | ||
``` | ||
[dependabot-core-dev] ~/dependabot-core $ cd swift && rspec | ||
``` | ||
|
||
[core-repo]: https://github.com/dependabot/dependabot-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
common_gemspec = | ||
Bundler.load_gemspec_uncached("../common/dependabot-common.gemspec") | ||
|
||
spec.name = "dependabot-swift" | ||
spec.summary = "Provides Dependabot support for Swift" | ||
spec.description = "Dependabot-Swift provides support for bumping Swift packages via Dependabot. " \ | ||
"If you want support for multiple package managers, you probably want the meta-gem " \ | ||
"dependabot-omnibus." | ||
|
||
spec.author = common_gemspec.author | ||
spec.email = common_gemspec.email | ||
spec.homepage = common_gemspec.homepage | ||
spec.license = common_gemspec.license | ||
|
||
spec.metadata = { | ||
"bug_tracker_uri" => common_gemspec.metadata["bug_tracker_uri"], | ||
"changelog_uri" => common_gemspec.metadata["changelog_uri"] | ||
} | ||
|
||
spec.version = common_gemspec.version | ||
spec.required_ruby_version = common_gemspec.required_ruby_version | ||
spec.required_rubygems_version = common_gemspec.required_ruby_version | ||
|
||
spec.require_path = "lib" | ||
spec.files = Dir["lib/**/*"] | ||
|
||
spec.add_dependency "dependabot-common", Dependabot::VERSION | ||
|
||
common_gemspec.development_dependencies.each do |dep| | ||
spec.add_development_dependency dep.name, *dep.requirement.as_list | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
# These all need to be required so the various classes can be registered in a | ||
# lookup table of package manager names to concrete classes. | ||
require "dependabot/swift/file_fetcher" | ||
require "dependabot/swift/file_parser" | ||
require "dependabot/swift/update_checker" | ||
require "dependabot/swift/file_updater" | ||
require "dependabot/swift/metadata_finder" | ||
require "dependabot/swift/requirement" | ||
require "dependabot/swift/version" | ||
|
||
require "dependabot/pull_request_creator/labeler" | ||
Dependabot::PullRequestCreator::Labeler. | ||
register_label_details("swift", name: "swift_package_manager", colour: "F05138") | ||
|
||
require "dependabot/dependency" | ||
Dependabot::Dependency. | ||
register_production_check("swift", ->(_) { true }) | ||
|
||
require "dependabot/utils" | ||
Dependabot::Utils.register_always_clone("swift") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/file_fetchers" | ||
require "dependabot/file_fetchers/base" | ||
|
||
module Dependabot | ||
module Swift | ||
class FileFetcher < Dependabot::FileFetchers::Base | ||
def self.required_files_in?(filenames) | ||
filenames.include?("Package.swift") | ||
end | ||
|
||
def self.required_files_message | ||
"Repo must contain a Package.swift configuration file." | ||
end | ||
|
||
private | ||
|
||
def fetch_files | ||
check_required_files_present | ||
|
||
fetched_files = [] | ||
fetched_files << package_manifest | ||
fetched_files << package_resolved if package_resolved | ||
fetched_files | ||
end | ||
|
||
def package_manifest | ||
@package_manifest ||= fetch_file_from_host("Package.swift") | ||
end | ||
|
||
def package_resolved | ||
return @package_resolved if defined?(@package_resolved) | ||
|
||
@package_resolved = fetch_file_if_present("Package.resolved") | ||
end | ||
|
||
def check_required_files_present | ||
return if package_manifest | ||
|
||
path = Pathname.new(File.join(directory, "Package.swift")). | ||
cleanpath.to_path | ||
raise Dependabot::DependencyFileNotFound, path | ||
end | ||
end | ||
end | ||
end | ||
|
||
Dependabot::FileFetchers. | ||
register("swift", Dependabot::Swift::FileFetcher) |
Oops, something went wrong.