From 1a396da258cba7057cb0bc770e09192bb49d2371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sat, 1 Apr 2023 11:55:07 +0200 Subject: [PATCH] Fix windows build --- .github/actions/setup/action.yml | 22 ++++++++-------------- .github/workflows/build.yml | 25 ++++++++++++------------- .github/workflows/release.yml | 6 +++--- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3c819e2..b1f388b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -10,20 +10,14 @@ runs: # Age on current Ubuntu doesn't support plugins # sudo apt-get update # sudo apt-get install age - curl -L -s https://github.com/FiloSottile/age/releases/download/v1.1.1/age-v1.1.1-linux-amd64.tar.gz | tar xvz -C /tmp - sudo mv /tmp/age/age /usr/bin - curl -L -s https://download.swift.org/swift-5.7.3-release/ubuntu2204/swift-5.7.3-RELEASE/swift-5.7.3-RELEASE-ubuntu22.04.tar.gz | tar xvz -C /tmp - sudo rsync -a /tmp/swift-5.7.3-RELEASE-ubuntu22.04/usr/ /usr/ + curl -L -s https://github.com/FiloSottile/age/releases/download/v1.1.1/age-v1.1.1-linux-amd64.tar.gz | tar xvz + echo "$GITHUB_WORKSPACE/age" >> $GITHUB_PATH shell: bash - if: runner.os == 'Windows' - run: | - choco install age.portable - # winget is currently not installed on GitHub runners - # winget install --accept-source-agreements Swift.Toolchain - Install-Binary -Url https://download.swift.org/swift-5.7.3-release/windows10/swift-5.7.3-RELEASE/swift-5.7.3-RELEASE-windows10.exe -Name SwiftInstaller.exe -ArgumentList("-q") - "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" >> $env:GITHUB_PATH - "C:\Program Files\swift\runtime-development\usr\bin" >> $env:GITHUB_PATH - "C:\Program Files\swift\icu-69.1\usr\bin" >> $env:GITHUB_PATH - "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" >> $env:GITHUB_ENV - "DEVELOPER_DIR=C:\Library\Developer" >> $env:GITHUB_ENV + run: choco install age.portable shell: pwsh + - if: runner.os == 'Windows' + uses: compnerd/gha-setup-swift@main + with: + branch: swift-5.8-release + tag: 5.8-RELEASE diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04e8e00..b7f0751 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,16 +38,15 @@ jobs: # Running swift from the Makefile doesn't work (yet), so we have a separate # build procedure for windows. - # FIXME: Fix the build again - # build-windows: - # runs-on: windows-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: ./.github/actions/setup - # - run: swift build - # # Unit tests don't seem to work yet - # # - run: swift test - # - name: Run smoke test - # run: | - # $Env:Path += ";" + (swift build --show-bin-path) - # echo "test" | age --encrypt --recipient age1se1qgg72x2qfk9wg3wh0qg9u0v7l5dkq4jx69fv80p6wdus3ftg6flwg5dz2dp -o secret.txt.age + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup + - run: swift build + # Unit tests don't seem to work yet + # - run: swift test + - name: Run smoke test + run: | + $Env:Path += ";" + (swift build --show-bin-path) + echo "test" | age --encrypt --recipient age1se1qgg72x2qfk9wg3wh0qg9u0v7l5dkq4jx69fv80p6wdus3ftg6flwg5dz2dp -o secret.txt.age diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 628d829..d227dec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,7 @@ jobs: needs: build strategy: matrix: - # os: [ubuntu-22.04, windows-latest] - os: [ubuntu-22.04] + os: [ubuntu-22.04, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -34,7 +33,8 @@ jobs: - name: "Upload artifacts" run: | for f in `find .build -maxdepth 1 -name 'age-plugin-se-*.tgz' -o -name 'age-plugin-se-*.zip'`; do - curl --fail \ + echo "Uploading: $f ($(file -b --mime-type $f))" + curl --fail-with-body --retry-all-errors --retry 5 \ -H "Authorization: token $GITHUB_TOKEN" \ -H "Content-Type: $(file -b --mime-type $f)" \ --data-binary @$f \