From 5edbacee46d8d6305fbabfab94b1bc77a846e65f Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 5 Nov 2025 20:00:21 -0800 Subject: [PATCH 1/2] Always use the current version of the scripts (Linux + Wasm) This applies the changes previously made for Android to: - Linux - Linux Static SDK - Wasm SDK - Embedded Wasm SDK --- .github/workflows/swift_package_test.yml | 93 +++++++++++++++++++++++- 1 file changed, 89 insertions(+), 4 deletions(-) diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index c86c42d7..01ee6de5 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -314,6 +314,27 @@ jobs: - name: Checkout repository uses: actions/checkout@v1 if: ${{ matrix.os_version == 'amazonlinux2' }} + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v4 + with: + repository: swiftlang/github-workflows + path: github-workflows + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v1 + with: + repository: swiftlang/github-workflows + path: github-workflows + ref: main + - name: Determine script-root path + id: script_path + run: | + if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then + echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT + else + echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT + fi - name: Provide token if: ${{ inputs.needs_token }} run: | @@ -322,7 +343,7 @@ jobs: if: ${{ inputs.enable_cross_pr_testing && github.event_name == 'pull_request' }} run: | apt-get update && apt-get install -y curl - curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift + cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/cross-pr-checkout.swift > /tmp/cross-pr-checkout.swift swift /tmp/cross-pr-checkout.swift "${{ github.repository }}" "${{ github.event.number }}" - name: Set environment variables if: ${{ inputs.linux_env_vars }} @@ -360,6 +381,27 @@ jobs: - name: Checkout repository uses: actions/checkout@v1 if: ${{ matrix.os_version == 'amazonlinux2' }} + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v4 + with: + repository: swiftlang/github-workflows + path: github-workflows + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v1 + with: + repository: swiftlang/github-workflows + path: github-workflows + ref: main + - name: Determine script-root path + id: script_path + run: | + if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then + echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT + else + echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT + fi - name: Provide token if: ${{ inputs.needs_token }} run: | @@ -390,7 +432,7 @@ jobs: echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 exit 1 fi - curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \ + cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \ bash -s -- --static --flags="$BUILD_FLAGS" --build-command="${{ inputs.linux_static_sdk_build_command }}" ${{ matrix.swift_version }} wasm-sdk-build: @@ -417,6 +459,27 @@ jobs: - name: Checkout repository uses: actions/checkout@v1 if: ${{ matrix.os_version == 'amazonlinux2' }} + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v4 + with: + repository: swiftlang/github-workflows + path: github-workflows + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v1 + with: + repository: swiftlang/github-workflows + path: github-workflows + ref: main + - name: Determine script-root path + id: script_path + run: | + if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then + echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT + else + echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT + fi - name: Provide token if: ${{ inputs.needs_token }} run: | @@ -447,7 +510,7 @@ jobs: echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 exit 1 fi - curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \ + cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \ bash -s -- --wasm --flags="$BUILD_FLAGS" --build-command="${{ inputs.wasm_sdk_build_command }}" ${{ matrix.swift_version }} embedded-wasm-sdk-build: @@ -470,6 +533,27 @@ jobs: run: clang --version - name: Checkout repository uses: actions/checkout@v4 + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v4 + with: + repository: swiftlang/github-workflows + path: github-workflows + - name: Checkout swiftlang/github-workflows repository + if: ${{ matrix.os_version == 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} + uses: actions/checkout@v1 + with: + repository: swiftlang/github-workflows + path: github-workflows + ref: main + - name: Determine script-root path + id: script_path + run: | + if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then + echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT + else + echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT + fi - name: Provide token if: ${{ inputs.needs_token }} run: | @@ -500,7 +584,7 @@ jobs: echo "Unknown package manager (tried apt-get, dnf, yum)" >&2 exit 1 fi - curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/scripts/install-and-build-with-sdk.sh | \ + cat ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/install-and-build-with-sdk.sh | \ bash -s -- --embedded-wasm --flags="$BUILD_FLAGS" ${{ matrix.swift_version }} android-sdk-build: @@ -540,6 +624,7 @@ jobs: with: repository: swiftlang/github-workflows path: github-workflows + ref: main - name: Determine script-root path id: script_path run: | From f0763ca6f85580a98d03b14094250788734053bb Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 5 Nov 2025 20:00:53 -0800 Subject: [PATCH 2/2] Apply checkout fix for Amazon Linux 2 to the embedded wasm SDK build This was missed earlier. --- .github/workflows/swift_package_test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/swift_package_test.yml b/.github/workflows/swift_package_test.yml index 01ee6de5..df1acc78 100644 --- a/.github/workflows/swift_package_test.yml +++ b/.github/workflows/swift_package_test.yml @@ -533,6 +533,10 @@ jobs: run: clang --version - name: Checkout repository uses: actions/checkout@v4 + if: ${{ matrix.os_version != 'amazonlinux2' }} + - name: Checkout repository + uses: actions/checkout@v1 + if: ${{ matrix.os_version == 'amazonlinux2' }} - name: Checkout swiftlang/github-workflows repository if: ${{ matrix.os_version != 'amazonlinux2' && github.repository != 'swiftlang/github-workflows' }} uses: actions/checkout@v4