Skip to content

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
remko committed Apr 2, 2023
1 parent e832f8a commit 1a396da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 30 deletions.
22 changes: 8 additions & 14 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down

0 comments on commit 1a396da

Please sign in to comment.