From 0ea05852ba1c0504ffd2e142a77369db81336a2c Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Fri, 18 Oct 2024 00:16:13 -0700 Subject: [PATCH 01/15] [install] Add Swiftly to the install page under beta/preview --- _includes/install/_linux_platforms_tabs.md | 20 +++++++++ install/linux/index.md | 1 - install/linux/swiftly/index.md | 48 ++++++++++++++++++++ install/macos/index.md | 13 +++++- install/macos/swiftly/index.md | 51 ++++++++++++++++++++++ 5 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 install/linux/swiftly/index.md create mode 100644 install/macos/swiftly/index.md diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md index 81b17f179..5b9bdc063 100644 --- a/_includes/install/_linux_platforms_tabs.md +++ b/_includes/install/_linux_platforms_tabs.md @@ -1,3 +1,23 @@ +## Toolchain Installer + + +## Alternate installation options +

Select Linux platform:

diff --git a/install/linux/index.md b/install/linux/index.md index f741e8b5f..9687fd51a 100644 --- a/install/linux/index.md +++ b/install/linux/index.md @@ -4,5 +4,4 @@ title: Install Swift --- {% include install/_os_tabs.md linux="true" %} - {% include install/_linux_platforms_tabs.md %} diff --git a/install/linux/swiftly/index.md b/install/linux/swiftly/index.md new file mode 100644 index 000000000..8b8b0d642 --- /dev/null +++ b/install/linux/swiftly/index.md @@ -0,0 +1,48 @@ +--- +layout: page +title: Getting Started with Swiftly +--- + +Download swiftly from the [install page](/install). + +Run the following command in your terminal, to configure swiftly for your account: + +``` +$ swiftly init +``` + +Once swiftly is installed you can use it to install the latest available swift toolchain like this: + +``` +$ swiftly install latest + +Fetching the latest stable Swift release... +Installing Swift 6.0.1 +Downloaded 488.5 MiB of 488.5 MiB +Extracting toolchain... +Swift 6.0.1 installed successfully! + +$ swift --version + +Swift version 6.0.1 (swift-6.0.1-RELEASE) +Target: x86_64-unknown-linux-gnu +``` + +Or, you can install (and use) a swift release: + +``` +$ swiftly install --use 5.10 + +$ swift --version + +Swift version 5.10 (swift-5.10-RELEASE) +Target: x86_64-unknown-linux-gnu +``` + +There's also an option to install the latest snapshot release and get access to the latest features: + +``` +$ swiftly install main-snapshot +``` + +> Note: This last example just installed the toolchain. You can run "swiftly use" to switch to it and other installed toolchahins when you're ready. diff --git a/install/macos/index.md b/install/macos/index.md index a16695c84..bb42f496d 100644 --- a/install/macos/index.md +++ b/install/macos/index.md @@ -5,8 +5,19 @@ title: Install Swift {% include install/_os_tabs.md macos="true" %} -## Latest Release (Swift {{ site.data.builds.swift_releases.last.name }}) +## Toolchain Installer + +## Latest Release (Swift {{ site.data.builds.swift_releases.last.name }}) diff --git a/install/macos/index.md b/install/macos/index.md index bb42f496d..586ab89c9 100644 --- a/install/macos/index.md +++ b/install/macos/index.md @@ -12,7 +12,13 @@ title: Install Swift

Command line tool for installing, managing, and switching between Swift.org toolchains.

- Download + + Download Instructions From 1cda4bfdc0622d083be8e8592e67e5d14a086032 Mon Sep 17 00:00:00 2001 From: Chris McGee <87777443+cmcgee1024@users.noreply.github.com> Date: Thu, 2 Jan 2025 01:02:35 -0500 Subject: [PATCH 03/15] Swiftly preview (#866) * Adjust the download URLs and instructions to support upcoming swiftly preview release * Correct the swiftly download URLs --------- Co-authored-by: Mishal Shah --- _includes/install/_linux_platforms_tabs.md | 6 +++--- install/macos/index.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md index 0afa02828..f54bf5574 100644 --- a/_includes/install/_linux_platforms_tabs.md +++ b/_includes/install/_linux_platforms_tabs.md @@ -9,10 +9,10 @@

To install swiftly, run the following commands in your terminal.


   SWIFTLY_FILENAME=swiftly-0.4.0-dev-$(uname -m).tar.gz
-  curl -s -O "https://download.swift.org/linux/$SWIFTLY_FILENAME" && tar zxf "$SWIFTLY_FILENAME" && ./swiftly init
+  curl -s -O "https://download.swift.org/swiftly/linux/$SWIFTLY_FILENAME" && tar zxf "$SWIFTLY_FILENAME" && ./swiftly init
   
--> -

License: Apache-2.0 | PGP: Signature

- Download +

License: Apache-2.0 | PGP: Signature

+ Download Instructions diff --git a/install/macos/index.md b/install/macos/index.md index 586ab89c9..0787cd214 100644 --- a/install/macos/index.md +++ b/install/macos/index.md @@ -16,9 +16,9 @@ title: Install Swift

To install swiftly, run the following command in your terminal.


   SWIFTLY_FILENAME=swiftly-0.4.0-dev.pkg
-  curl -O -s "https://download.swift.org/macos/$SWIFTLY_FILENAME" && installer -pkg "$SWIFTLY_FILENAME" -target CurrentUserHomeDirectory && ~/usr/local/bin/swiftly init
+  curl -O -s "https://download.swift.org/swiftly/darwin/$SWIFTLY_FILENAME" && installer -pkg "$SWIFTLY_FILENAME" -target CurrentUserHomeDirectory && ~/usr/local/bin/swiftly init
   
--> - Download + Download Instructions From 27961857af73c096042950b40726396736547931 Mon Sep 17 00:00:00 2001 From: Ben Cohen Date: Mon, 3 Feb 2025 20:21:41 +0100 Subject: [PATCH 04/15] Update swiftly install pages (#887) * Tweak wording, replace mac package option with Swiftly * Wording tweaks for Linux, raise Docker prominence. --------- Co-authored-by: Ben Cohen --- _includes/install/_linux_platforms_tabs.md | 16 ++++++--- install/macos/index.md | 42 ++++++++++------------ 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md index f54bf5574..dad10177f 100644 --- a/_includes/install/_linux_platforms_tabs.md +++ b/_includes/install/_linux_platforms_tabs.md @@ -1,9 +1,9 @@ -## Toolchain Installer -
    +## Latest Release +
      -
    - -## Latest Release (Swift {{ site.data.builds.swift_releases.last.name }}) +## Latest Release
    • Xcode

      - Download the latest version of Xcode, which is regularly refreshed with the latest Swift toolchain. + To develop with Swift for Apple platforms, download the latest version of Xcode, which is regularly refreshed with the latest Swift toolchain.

      Install Xcode
    • + +
    + + +## Other Install Options +
    • Package Installer

      - Toolchain package installer (.pkg) + The toolchain package installer (.pkg) that Swiftly automates is available as a stand-alone download.

      Download Toolchain Instructions
    • -
    - -
      {% include install/_static_sdk_release.md %}
    @@ -57,6 +49,8 @@ title: Install Swift Swift snapshots are prebuilt binaries that are automatically created from the branch. These snapshots are not official releases. They have gone through automated unit testing, but they have not gone through the full testing that is performed for official releases. +The easiest way to install development snapshots is with the Swiftly tool. Read more on the [instructions page](/install/macos/swiftly). + {% assign xcode_dev_builds = site.data.builds.development.xcode | sort: 'date' | reverse %} {% assign xcode_6_1_builds = site.data.builds.swift-6_1-branch.xcode | sort: 'date' | reverse %} From 6bc1224f5f518b84a44af85ceae6afda30c8e50f Mon Sep 17 00:00:00 2001 From: Eric Ernst Date: Mon, 3 Feb 2025 18:10:24 -0800 Subject: [PATCH 05/15] container install directions (#888) Signed-off-by: Eric Ernst --- _includes/install/_linux_platforms_tabs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md index dad10177f..821048dce 100644 --- a/_includes/install/_linux_platforms_tabs.md +++ b/_includes/install/_linux_platforms_tabs.md @@ -16,9 +16,9 @@ Instructions
  • -

    Docker

    +

    Container

    - If you prefer a containerized environment, you can download the official Docker images for compiling and running Swift on a variety of distributions. + If you prefer a containerized environment, you can download the official container images for compiling and running Swift on a variety of distributions.

    Docker Hub Instructions From 5e036b847cd8bb2241070d44e3aab604dc5d3b4f Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 25 Feb 2025 12:13:56 -0800 Subject: [PATCH 06/15] Update _includes/install/_linux_platforms_tabs.md --- _includes/install/_linux_platforms_tabs.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md index 821048dce..461d28d83 100644 --- a/_includes/install/_linux_platforms_tabs.md +++ b/_includes/install/_linux_platforms_tabs.md @@ -5,12 +5,6 @@

    The Swiftly installer manages Swift and its dependencies. It supports switching between different versions and downloading updates.

    -

    License: Apache-2.0 | PGP: Signature

    Download Instructions From b01fa81046ba62f97e4a9d60007178740dbb0f2a Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 10 Mar 2025 20:28:39 -0700 Subject: [PATCH 07/15] Update the install command for Swiftly --- _data/builds/swiftly_release.yml | 10 ++++---- _includes/install/_linux_platforms_tabs.md | 14 ++++++++--- install/macos/index.md | 27 ++++++++++++++-------- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/_data/builds/swiftly_release.yml b/_data/builds/swiftly_release.yml index 7a55fdec1..ae91ab9bc 100644 --- a/_data/builds/swiftly_release.yml +++ b/_data/builds/swiftly_release.yml @@ -1,8 +1,8 @@ -version: "0.4.0-dev" +version: "1.0.0" platforms: - platform: Linux - x86_64: "https://download.swift.org/swiftly/linux/swiftly-0.4.0-dev-x86_64.tar.gz" - arm64: "https://download.swift.org/swiftly/linux/swiftly-0.4.0-dev-aarch64.tar.gz" + x86_64: "https://download.swift.org/swiftly/linux/swiftly-1.0.0-dev-x86_64.tar.gz" + arm64: "https://download.swift.org/swiftly/linux/swiftly-1.0.0-dev-aarch64.tar.gz" - platform: Darwin - x86_64: "https://download.swift.org/swiftly/darwin/swiftly-0.4.0-dev.pkg" - arm64: "https://download.swift.org/swiftly/darwin/swiftly-0.4.0-dev.pkg" + x86_64: "https://download.swift.org/swiftly/darwin/swiftly-1.0.0-dev.pkg" + arm64: "https://download.swift.org/swiftly/darwin/swiftly-1.0.0-dev.pkg" diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md index 461d28d83..46528bbd1 100644 --- a/_includes/install/_linux_platforms_tabs.md +++ b/_includes/install/_linux_platforms_tabs.md @@ -1,15 +1,23 @@ ## Latest Release -
      +
        -
      • +
      +
        +
      • Container

        If you prefer a containerized environment, you can download the official container images for compiling and running Swift on a variety of distributions. diff --git a/install/macos/index.md b/install/macos/index.md index e83ba3c15..a7573d017 100644 --- a/install/macos/index.md +++ b/install/macos/index.md @@ -6,23 +6,32 @@ title: Install Swift {% include install/_os_tabs.md macos="true" %} ## Latest Release -

          -
        • -

          Xcode

          -

          - To develop with Swift for Apple platforms, download the latest version of Xcode, which is regularly refreshed with the latest Swift toolchain. -

          - Install Xcode -
        • +
          +
            +
          • +

            Xcode

            +

            + To develop with Swift for Apple platforms, download the latest version of Xcode, which is regularly refreshed with the latest Swift toolchain. +

            + Install Xcode +
          • +
          ## Other Install Options From 696690df8b89e206855b5bb08c4c860b5714169e Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Mon, 10 Mar 2025 22:00:39 -0700 Subject: [PATCH 08/15] Update the Getting started pages for Swiftly --- install/linux/swiftly/index.md | 57 ++++++++++++++++++++------------ install/macos/swiftly/index.md | 60 +++++++++++++++++++--------------- 2 files changed, 71 insertions(+), 46 deletions(-) diff --git a/install/linux/swiftly/index.md b/install/linux/swiftly/index.md index 8b8b0d642..d408f4aea 100644 --- a/install/linux/swiftly/index.md +++ b/install/linux/swiftly/index.md @@ -1,48 +1,65 @@ --- layout: page -title: Getting Started with Swiftly +title: Getting Started with Swiftly on Linux --- -Download swiftly from the [install page](/install). -Run the following command in your terminal, to configure swiftly for your account: +If you are using Linux then you can download the archive: ``` -$ swiftly init +curl -O https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz ``` -Once swiftly is installed you can use it to install the latest available swift toolchain like this: - +Extract the archive: +``` +tar zxf swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz ``` -$ swiftly install latest -Fetching the latest stable Swift release... -Installing Swift 6.0.1 -Downloaded 488.5 MiB of 488.5 MiB -Extracting toolchain... -Swift 6.0.1 installed successfully! +Now run swiftly init to finish the installation: + +``` +./swiftly init +``` +Swiftly will install itself and download the latest available Swift toolchain. Follow the prompts for any additional steps. Once everything is done you can begin using swift. +``` $ swift --version -Swift version 6.0.1 (swift-6.0.1-RELEASE) -Target: x86_64-unknown-linux-gnu + +Swift version 6.0.3 (swift-6.0.3-RELEASE) +... + + +$ swift build # Build with the latest (6.0.3) toolchain ``` -Or, you can install (and use) a swift release: +You can install (and use) another release toolchain: ``` $ swiftly install --use 5.10 + $ swift --version -Swift version 5.10 (swift-5.10-RELEASE) -Target: x86_64-unknown-linux-gnu -``` -There's also an option to install the latest snapshot release and get access to the latest features: +Swift version 5.10.1 (swift-5.10.1-RELEASE) +... + + +$ swift build # Build with the 5.10.1 toolchain +``` +Quickly test your package with the latest nightly snapshot to prepare for the next release: ``` $ swiftly install main-snapshot +$ swiftly run swift test +main-snapshot # Run "swift test" with the main-snapshot toolchain +$ swift build # Continue to build with my usual toolchain +``` + +Uninstall this toolchain after you’re finished with it: + +``` +$ swiftly uninstall main-snapshot ``` -> Note: This last example just installed the toolchain. You can run "swiftly use" to switch to it and other installed toolchahins when you're ready. +[Learn more about Swiftly](https://www.swift.org/swiftly/documentation/swiftlydocs) \ No newline at end of file diff --git a/install/macos/swiftly/index.md b/install/macos/swiftly/index.md index 8f868a9d6..d1db2845c 100644 --- a/install/macos/swiftly/index.md +++ b/install/macos/swiftly/index.md @@ -1,51 +1,59 @@ --- layout: page -title: Getting Started with Swiftly +title: Getting Started with Swiftly on macOS --- -Download swiftly from the [install page](/install). - -Run the following command in your terminal, to configure swiftly for your account: - +On macOS you can run download the pkg: ``` -$ swiftly init +curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg ``` -Once swiftly is installed you can use it to install the latest available swift toolchain like this: +Run the pkg installer from the command-line like this: +``` +installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory +``` +Now run swiftly init to finish the installation: +``` +/usr/local/bin/swiftly init ``` -$ swiftly install latest +Swiftly will install itself and download the latest available Swift toolchain. Follow the prompts for any additional steps. Once everything is done you can begin using swift. +``` +$ swift --version -Fetching the latest stable Swift release... -Installing Swift 6.0.1 -Downloaded 1355.3 MiB of 1355.3 MiB -Installing package in user home directory... -installer: Package name is Swift Open Source Xcode Toolchain -installer: Upgrading at base path /Users/swift -installer: The upgrade was successful. -Swift 6.0.1 installed successfully! -$ swift --version +Swift version 6.0.3 (swift-6.0.3-RELEASE) +... -Apple Swift version 6.0.1 (swift-6.0.1-RELEASE) -Target: arm64-apple-macosx15.0 -``` -Or, you can install (and use) a swift release: +$ swift build # Build with the latest (6.0.3) toolchain +``` +You can install (and use) another release toolchain: ``` $ swiftly install --use 5.10 + $ swift --version -Apple Swift version 5.10 (swift-5.10-RELEASE) -Target: arm64-apple-macosx15.0 -``` -There's also an option to install the latest snapshot release and get access to the latest features: +Swift version 5.10.1 (swift-5.10.1-RELEASE) +... + +$ swift build # Build with the 5.10.1 toolchain +``` + +Quickly test your package with the latest nightly snapshot to prepare for the next release: ``` $ swiftly install main-snapshot +$ swiftly run swift test +main-snapshot # Run "swift test" with the main-snapshot toolchain +$ swift build # Continue to build with my usual toolchain +``` + +Uninstall this toolchain after you’re finished with it: +``` +$ swiftly uninstall main-snapshot ``` -> Note: This last example just installed the toolchain. You can run "swiftly use" to switch to it and other installed toolchahins when you're ready. +[Learn more about Swiftly](https://www.swift.org/swiftly/documentation/swiftlydocs) \ No newline at end of file From ea707ba6520ef16e0989948a197d7fca6d1899d5 Mon Sep 17 00:00:00 2001 From: Federico Bucchi Date: Tue, 11 Mar 2025 12:50:56 -0700 Subject: [PATCH 09/15] Add copy code button --- assets/javascripts/application.js | 19 +++++++++++++++++++ assets/stylesheets/elements/_grid.scss | 13 ++++++++++--- install/macos/index.md | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/application.js b/assets/javascripts/application.js index 5a3841eca..f807674bf 100644 --- a/assets/javascripts/application.js +++ b/assets/javascripts/application.js @@ -87,5 +87,24 @@ layout: source } }) } + + if (navigator && navigator.clipboard) { + const copyCodeButtons = document.querySelectorAll('[class^="language-"] button'); + + copyCodeButtons.forEach(function(button) { + const codeElement = button.parentElement.querySelector('code'); + const originalText = button.innerText; + + button.addEventListener('mousedown', async function() { + await navigator.clipboard.writeText(codeElement.innerText); + + button.innerText = 'Copied!'; + + setTimeout(() => { + button.innerText = originalText; + }, 1000); + }); + }); + } }); })(); diff --git a/assets/stylesheets/elements/_grid.scss b/assets/stylesheets/elements/_grid.scss index fb2d1fd59..a64945909 100644 --- a/assets/stylesheets/elements/_grid.scss +++ b/assets/stylesheets/elements/_grid.scss @@ -9,7 +9,7 @@ background-color: var(--color-fill-secondary); border: 1px solid var(--color-fill-tertiary); border-radius: var(--border-radius); - + padding: 1rem; display: flex; flex-direction: column; @@ -77,7 +77,7 @@ } // Button typically embedded in a grid-level-1 -a.cta-secondary { +a.cta-secondary, [class^="language-"] button { background-color: var(--color-fill-tertiary); border: 1px solid var(--color-fill-quaternary); border-radius: var(--border-radius); @@ -99,7 +99,7 @@ a.cta-secondary { &:hover { color: var(--color-link); background-color: var(--color-fill-quaternary); - + text-decoration: none; @media (prefers-contrast: more) { @@ -112,3 +112,10 @@ a.cta-secondary { content: " ↗"; } } + +[class^="language-"] button { + cursor: pointer; + padding: 0.1rem 0.4rem; + margin-left: auto; + font-size: 0.8rem; +} diff --git a/install/macos/index.md b/install/macos/index.md index a7573d017..9b00642c0 100644 --- a/install/macos/index.md +++ b/install/macos/index.md @@ -13,7 +13,7 @@ title: Install Swift To download toolchains from Swift.org, use the Swiftly toolchain installer. Swift.org toolchains include experimental features like Embedded Swift and support for WebAssembly.

          Run this in a terminal:

          -
          curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg && \
          +  
          curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg && \
           installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory && \
           ~/usr/local/bin/swiftly init --quiet-shell-followup && \
           . ~/Library/Application\ Support/swiftly/env.sh && \
          
          From 7fae307f046871a56ada7614bdef4ea3b260fef4 Mon Sep 17 00:00:00 2001
          From: Federico Bucchi 
          Date: Tue, 11 Mar 2025 18:36:53 -0700
          Subject: [PATCH 10/15] Shoe copy button only at code block hover
          
          ---
           assets/stylesheets/elements/_grid.scss | 14 +++++++++++++-
           install/macos/index.md                 |  2 +-
           2 files changed, 14 insertions(+), 2 deletions(-)
          
          diff --git a/assets/stylesheets/elements/_grid.scss b/assets/stylesheets/elements/_grid.scss
          index a64945909..e7c6544b0 100644
          --- a/assets/stylesheets/elements/_grid.scss
          +++ b/assets/stylesheets/elements/_grid.scss
          @@ -113,9 +113,21 @@ a.cta-secondary, [class^="language-"] button {
             }
           }
           
          +div.highlight {
          +  position: relative;
          +
          +  &:hover [class^="language-"] button {
          +    display: block;
          +  }
          +}
          +
           [class^="language-"] button {
             cursor: pointer;
             padding: 0.1rem 0.4rem;
          -  margin-left: auto;
             font-size: 0.8rem;
          +  position: absolute;
          +  right: 0.4rem;
          +  top: 0.4rem;
          +  margin: 0;
          +  display: none;
           }
          diff --git a/install/macos/index.md b/install/macos/index.md
          index 9b00642c0..71d14d0ec 100644
          --- a/install/macos/index.md
          +++ b/install/macos/index.md
          @@ -13,7 +13,7 @@ title: Install Swift
               To download toolchains from Swift.org, use the Swiftly toolchain installer. Swift.org toolchains include experimental features like Embedded Swift and support for WebAssembly.
             

          Run this in a terminal:

          -
          curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg && \
          +  
          curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg && \
           installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory && \
           ~/usr/local/bin/swiftly init --quiet-shell-followup && \
           . ~/Library/Application\ Support/swiftly/env.sh && \
          
          From 462701bc85dc9d694cfc8afd061f4480db2c0258 Mon Sep 17 00:00:00 2001
          From: Mishal Shah 
          Date: Tue, 11 Mar 2025 23:22:53 -0700
          Subject: [PATCH 11/15] Add copy button for Linux
          
          ---
           _includes/install/_linux_platforms_tabs.md |  2 +-
           assets/stylesheets/elements/_grid.scss     |  2 +-
           install/linux/swiftly/index.md             | 62 +++++++++++-----------
           install/macos/swiftly/index.md             | 60 ++++++++++-----------
           4 files changed, 63 insertions(+), 63 deletions(-)
          
          diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md
          index 46528bbd1..6de3197ba 100644
          --- a/_includes/install/_linux_platforms_tabs.md
          +++ b/_includes/install/_linux_platforms_tabs.md
          @@ -6,7 +6,7 @@
               The Swiftly installer manages Swift and its dependencies. It supports switching between different versions and downloading updates.
             

          Run this in a terminal:

          -
          curl -O https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz && \
          +  
          curl -O https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz && \
           tar zxf swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz && \
           ./swiftly init --quiet-shell-followup && \
           . ~/.local/share/swiftly/env.sh && \
          diff --git a/assets/stylesheets/elements/_grid.scss b/assets/stylesheets/elements/_grid.scss
          index e7c6544b0..45506c9ee 100644
          --- a/assets/stylesheets/elements/_grid.scss
          +++ b/assets/stylesheets/elements/_grid.scss
          @@ -116,7 +116,7 @@ a.cta-secondary, [class^="language-"] button {
           div.highlight {
             position: relative;
           
          -  &:hover [class^="language-"] button {
          +  &:hover button {
               display: block;
             }
           }
          diff --git a/install/linux/swiftly/index.md b/install/linux/swiftly/index.md
          index d408f4aea..0c3ca1a89 100644
          --- a/install/linux/swiftly/index.md
          +++ b/install/linux/swiftly/index.md
          @@ -3,63 +3,65 @@ layout: page
           title: Getting Started with Swiftly on Linux
           ---
           
          -
          -If you are using Linux then you can download the archive:
          +Download swiftly for [Linux (Intel)](https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-x86_64.tar.gz), or [Linux (ARM)](https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-aarch64.tar.gz).
           
           ```
           curl -O https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz
           ```
           
          -Extract the archive:
          +You can verify the integrity of the archive using the PGP signature. This will download the signature, install the swift.org signatures into your keychain, and verify the signature.
          +
           ```
          -tar zxf swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz 
          +curl https://www.swift.org/keys/all-keys.asc | gpg --import -
          +curl -O https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz.sig
          +gpg --verify swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz.sig swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz
           ```
           
          -Now run swiftly init to finish the installation:
          +Extract the archive.
           
           ```
          -./swiftly init
          +tar -zxf swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz
           ```
          -Swiftly will install itself and download the latest available Swift toolchain. Follow the prompts for any additional steps. Once everything is done you can begin using swift.
          -
          -```
          -$ swift --version
          -
          -
          -Swift version 6.0.3 (swift-6.0.3-RELEASE)
          -...
           
          +Run the following command in your terminal, to configure swiftly for your account, and automatically download the latest swift toolchain.
           
          -$ swift build        # Build with the latest (6.0.3) toolchain
           ```
          -
          -You can install (and use) another release toolchain:
          -
          +./swiftly init
           ```
          -$ swiftly install --use 5.10
           
          +Your current shell may need some additional steps to update your session. Follow the guidance at the end of the installation for a smooth install experience, such as sourcing the environment file, and rehashing your shell's PATH.
           
          -$ swift --version
          +There can be certain packages that need to be installed on your system so that the Swift toolchain can function. The swiftly initialization routine will show you how to install any missing packages.
           
          +Now that swiftly and swift are installed, you can access the `swift` command from the latest Swift release:
           
          -Swift version 5.10.1 (swift-5.10.1-RELEASE)
          -...
          +```
          +swift --version
          +--
          +Swift version {{ site.data.builds.swift_releases.last.name }} (swift-{{ site.data.builds.swift_releases.last.name }}-RELEASE)
          +Target: x86_64-unknown-linux-gnu
          +```
           
          +Or, you can install (and use) another swift release:
           
          -$ swift build    # Build with the 5.10.1 toolchain
           ```
          +swiftly install --use 5.10
          +swift --version
          +--
          +Swift version 5.10 (swift-5.10-RELEASE)
          +Target: x86_64-unknown-linux-gnu
          +```
          +
          +There's also an option to install the latest snapshot release and get access to the latest features:
           
          -Quickly test your package with the latest nightly snapshot to prepare for the next release:
           ```
          -$ swiftly install main-snapshot
          -$ swiftly run swift test +main-snapshot   # Run "swift test" with the main-snapshot toolchain
          -$ swift build                             # Continue to build with my usual toolchain
          +swiftly install --use main-snapshot
           ```
           
          -Uninstall this toolchain after you’re finished with it:
          +Check for updates to swiftly and install them by running the self-update command:
           
           ```
          -$ swiftly uninstall main-snapshot
          +swiftly self-update
           ```
           
          -[Learn more about Swiftly](https://www.swift.org/swiftly/documentation/swiftlydocs)
          \ No newline at end of file
          +You can discover more about swiftly in the [documentation](https://www.swift.org/swiftly/documentation/swiftlydocs/)
          \ No newline at end of file
          diff --git a/install/macos/swiftly/index.md b/install/macos/swiftly/index.md
          index d1db2845c..e7a0a0972 100644
          --- a/install/macos/swiftly/index.md
          +++ b/install/macos/swiftly/index.md
          @@ -3,57 +3,55 @@ layout: page
           title: Getting Started with Swiftly on macOS
           ---
           
          -On macOS you can run download the pkg:
          -```
          -curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg
          -```
          +Download the [swiftly package for macOS](https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg).
          +
          +Install the package in your user account:
           
          -Run the pkg installer from the command-line like this:
           ```
           installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory
           ```
           
          -Now run swiftly init to finish the installation:
          -```
          -/usr/local/bin/swiftly init
          +Run the following command in your terminal, to configure swiftly for your account, and automatically download the latest swift toolchain.
          +
           ```
          -Swiftly will install itself and download the latest available Swift toolchain. Follow the prompts for any additional steps. Once everything is done you can begin using swift.
          +~/usr/local/bin/swiftly init
           ```
          -$ swift --version
           
          +
          +Depending on how you installed the package the swiftly binary can be in your home directory. You can run in from there like this: `~/swiftly init` -Swift version 6.0.3 (swift-6.0.3-RELEASE) -... +Your current shell may need some additional steps to update your session. Follow the guidance at the end of the installation for a smooth install experience, such as sourcing the environment file, and rehashing your shell's PATH. +
          +Now that swiftly and swift are installed, you can access the `swift` command from the latest Swift release: -$ swift build # Build with the latest (6.0.3) toolchain ``` - -You can install (and use) another release toolchain: +swift --version +-- +Apple Swift version {{ site.data.builds.swift_releases.last.name }} (swift-{{ site.data.builds.swift_releases.last.name }}-RELEASE) +Target: arm64-apple-macosx15.0 ``` -$ swiftly install --use 5.10 - -$ swift --version +Or, you can install (and use) another swift release: - -Swift version 5.10.1 (swift-5.10.1-RELEASE) -... - - -$ swift build # Build with the 5.10.1 toolchain ``` +swiftly install --use 5.10 +swift --version +-- +Apple Swift version 5.10 (swift-5.10-RELEASE) +Target: arm64-apple-macosx15.0 +``` + +There's also an option to install the latest snapshot release and get access to the latest features: -Quickly test your package with the latest nightly snapshot to prepare for the next release: ``` -$ swiftly install main-snapshot -$ swiftly run swift test +main-snapshot # Run "swift test" with the main-snapshot toolchain -$ swift build # Continue to build with my usual toolchain +swiftly install --use main-snapshot ``` -Uninstall this toolchain after you’re finished with it: +Check for updates to swiftly and install them by running the self-update command: + ``` -$ swiftly uninstall main-snapshot +swiftly self-update ``` -[Learn more about Swiftly](https://www.swift.org/swiftly/documentation/swiftlydocs) \ No newline at end of file +You can discover more about swiftly in the [documentation](https://www.swift.org/swiftly/documentation/swiftlydocs/) \ No newline at end of file From c088e33ab5e2162cf69340414b3b82b9c6b8065a Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 11 Mar 2025 23:36:37 -0700 Subject: [PATCH 12/15] Don't jump to the platforms on linux page --- _includes/install/_os_tabs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/install/_os_tabs.md b/_includes/install/_os_tabs.md index 103c8486d..0ed775013 100644 --- a/_includes/install/_os_tabs.md +++ b/_includes/install/_os_tabs.md @@ -3,7 +3,7 @@ Follow the instructions below to install the latest version of Swift on a [suppo From b5cd470e276bab2313a07b8549362239fd36c75c Mon Sep 17 00:00:00 2001 From: Chris McGee <87777443+cmcgee1024@users.noreply.github.com> Date: Wed, 12 Mar 2025 14:06:50 -0400 Subject: [PATCH 13/15] Fix swiftly macos GSG instructions to remove unnecessary paragraph (#926) --- install/macos/swiftly/index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/install/macos/swiftly/index.md b/install/macos/swiftly/index.md index e7a0a0972..172b5ed09 100644 --- a/install/macos/swiftly/index.md +++ b/install/macos/swiftly/index.md @@ -18,8 +18,6 @@ Run the following command in your terminal, to configure swiftly for your accoun ```
          -Depending on how you installed the package the swiftly binary can be in your home directory. You can run in from there like this: `~/swiftly init` - Your current shell may need some additional steps to update your session. Follow the guidance at the end of the installation for a smooth install experience, such as sourcing the environment file, and rehashing your shell's PATH.
          @@ -54,4 +52,4 @@ Check for updates to swiftly and install them by running the self-update command swiftly self-update ``` -You can discover more about swiftly in the [documentation](https://www.swift.org/swiftly/documentation/swiftlydocs/) \ No newline at end of file +You can discover more about swiftly in the [documentation](https://www.swift.org/swiftly/documentation/swiftlydocs/) From 3aa41bd9e8125a71b5bb71c2b2855be854e55183 Mon Sep 17 00:00:00 2001 From: Chris McGee <87777443+cmcgee1024@users.noreply.github.com> Date: Thu, 27 Mar 2025 17:36:49 -0400 Subject: [PATCH 14/15] Update swiftly install one-liner and instructions (#936) * Update the one-liners to explicitly set a swiftly home dir so that the source line works. Update the swiftly path for macOS based on installer changes * Add notes about the environment variables and install location customization * Fix awkward wording in install note. * Fix awkward wording in macOS install note * Adjust the one-liners and installation pages for macOS and Linux --- install/linux/swiftly/index.md | 4 +++- install/macos/index.md | 4 ++-- install/macos/swiftly/index.md | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/install/linux/swiftly/index.md b/install/linux/swiftly/index.md index 0c3ca1a89..e45dbf3ae 100644 --- a/install/linux/swiftly/index.md +++ b/install/linux/swiftly/index.md @@ -29,6 +29,8 @@ Run the following command in your terminal, to configure swiftly for your accoun ./swiftly init ``` +Note: You can set the SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR environment variables to customize your install location. + Your current shell may need some additional steps to update your session. Follow the guidance at the end of the installation for a smooth install experience, such as sourcing the environment file, and rehashing your shell's PATH. There can be certain packages that need to be installed on your system so that the Swift toolchain can function. The swiftly initialization routine will show you how to install any missing packages. @@ -64,4 +66,4 @@ Check for updates to swiftly and install them by running the self-update command swiftly self-update ``` -You can discover more about swiftly in the [documentation](https://www.swift.org/swiftly/documentation/swiftlydocs/) \ No newline at end of file +You can discover more about swiftly in the [documentation](https://www.swift.org/swiftly/documentation/swiftlydocs/) diff --git a/install/macos/index.md b/install/macos/index.md index 71d14d0ec..531af22e6 100644 --- a/install/macos/index.md +++ b/install/macos/index.md @@ -15,8 +15,8 @@ title: Install Swift

          Run this in a terminal:

          curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg && \
           installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory && \
          -~/usr/local/bin/swiftly init --quiet-shell-followup && \
          -. ~/Library/Application\ Support/swiftly/env.sh && \
          +~/.swiftly/bin/swiftly init --quiet-shell-followup && \
          +. ~/.swiftly/env.sh && \
           hash -r
           

          License: Apache-2.0

          diff --git a/install/macos/swiftly/index.md b/install/macos/swiftly/index.md index 172b5ed09..84ba83e25 100644 --- a/install/macos/swiftly/index.md +++ b/install/macos/swiftly/index.md @@ -14,9 +14,11 @@ installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -targe Run the following command in your terminal, to configure swiftly for your account, and automatically download the latest swift toolchain. ``` -~/usr/local/bin/swiftly init +~/.swiftly/bin/swiftly init ``` +Note: You can set the SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR environment variables to customize the install location. +
          Your current shell may need some additional steps to update your session. Follow the guidance at the end of the installation for a smooth install experience, such as sourcing the environment file, and rehashing your shell's PATH.
          From 5f0c2e49a1e5fd80940d6d21e2f6628c468ee0bb Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Fri, 28 Mar 2025 00:03:16 -0700 Subject: [PATCH 15/15] Update the install command to use latest swiftly installer --- _includes/install/_linux_platforms_tabs.md | 4 ++-- install/macos/index.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_includes/install/_linux_platforms_tabs.md b/_includes/install/_linux_platforms_tabs.md index 6de3197ba..fd8972220 100644 --- a/_includes/install/_linux_platforms_tabs.md +++ b/_includes/install/_linux_platforms_tabs.md @@ -6,8 +6,8 @@ The Swiftly installer manages Swift and its dependencies. It supports switching between different versions and downloading updates.

          Run this in a terminal:

          -
          curl -O https://download.swift.org/swiftly/linux/swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz && \
          -tar zxf swiftly-{{ site.data.builds.swiftly_release.version }}-$(uname -m).tar.gz && \
          +  
          curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \
          +tar zxf swiftly-$(uname -m).tar.gz && \
           ./swiftly init --quiet-shell-followup && \
           . ~/.local/share/swiftly/env.sh && \
           hash -r
          diff --git a/install/macos/index.md b/install/macos/index.md
          index 531af22e6..393ff542d 100644
          --- a/install/macos/index.md
          +++ b/install/macos/index.md
          @@ -13,8 +13,8 @@ title: Install Swift
               To download toolchains from Swift.org, use the Swiftly toolchain installer. Swift.org toolchains include experimental features like Embedded Swift and support for WebAssembly.
             

          Run this in a terminal:

          -
          curl -O https://download.swift.org/swiftly/darwin/swiftly-{{ site.data.builds.swiftly_release.version }}.pkg && \
          -installer -pkg swiftly-{{ site.data.builds.swiftly_release.version }}.pkg -target CurrentUserHomeDirectory && \
          +  
          curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
          +installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \
           ~/.swiftly/bin/swiftly init --quiet-shell-followup && \
           . ~/.swiftly/env.sh && \
           hash -r