@@ -89,11 +89,10 @@ jobs:
8989 dist-args : --artifacts=global
9090 target : ' '
9191 install-dist : curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.0.4/cargo-dist-v0.0.4-installer.sh | sh
92- # Since we don't have a macos-11 runner, we will build manually on mac and upload
93- # - os: macos-11
94- # dist-args: --artifacts=local --target=aarch64-apple-darwin --target=x86_64-apple-darwin
95- # target: 'aarch64-apple-darwin x86_64-apple-darwin'
96- # install-dist: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.0.4/cargo-dist-v0.0.4-installer.sh | sh
92+ - os : macos-11
93+ dist-args : --artifacts=local --target=aarch64-apple-darwin --target=x86_64-apple-darwin
94+ target : ' aarch64-apple-darwin x86_64-apple-darwin'
95+ install-dist : curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.0.4/cargo-dist-v0.0.4-installer.sh | sh
9796 - os : ubuntu-20.04
9897 dist-args : --artifacts=local --target=x86_64-unknown-linux-gnu
9998 target : ' x86_64-unknown-linux-gnu'
@@ -102,11 +101,10 @@ jobs:
102101 dist-args : --artifacts=local --target=aarch64-unknown-linux-gnu
103102 target : ' aarch64-unknown-linux-gnu'
104103 install-dist : curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.0.4/cargo-dist-v0.0.4-installer.sh | sh
105- # We don't care for windows right now
106- # - os: windows-2019
107- # dist-args: --artifacts=local --target=x86_64-pc-windows-msvc
108- # target: 'x86_64-pc-windows-msvc'
109- # install-dist: irm https://github.com/axodotdev/cargo-dist/releases/download/v0.0.4/cargo-dist-v0.0.4-installer.ps1 | iex
104+ - os : windows-2019
105+ dist-args : --artifacts=local --target=x86_64-pc-windows-msvc
106+ target : ' x86_64-pc-windows-msvc'
107+ install-dist : irm https://github.com/axodotdev/cargo-dist/releases/download/v0.0.4/cargo-dist-v0.0.4-installer.ps1 | iex
110108
111109 runs-on : ${{ matrix.os }}
112110 env :
@@ -124,7 +122,35 @@ jobs:
124122 # The two platforms don't agree on how to talk about env vars but they
125123 # do agree on 'cat' and '$()' so we use that to marshal values between commands.
126124 run : |
127- scripts/build.sh --target "${{ matrix.target }}" --version "${{ github.ref_name }}"
125+ pip3 install ziglang
126+ cargo install cargo-zigbuild
127+ rustup target add ${{ matrix.target }}
128+ cargo zigbuild --target ${{ matrix.target }} --release
129+
130+ # Set binary name to typeshare
131+ BINARY_NAME="typeshare"
132+ TARGET_DIR="target/${{ matrix.target }}/release"
133+
134+ # Create zip directory
135+ mkdir -p "dist"
136+
137+ # Create zip file with binary
138+ ZIP_NAME="${BINARY_NAME}-${{ github.ref_name }}-${{ matrix.target }}.zip"
139+ cd ${TARGET_DIR} && zip "../../../dist/${ZIP_NAME}" "${BINARY_NAME}${BINARY_SUFFIX}"
140+ cd ../../..
141+
142+ # Create manifest file similar to cargo-dist
143+ echo "{\"artifacts\" : [{\"path\": \"dist/${ZIP_NAME}\"}]}" > dist-manifest.json
144+
145+ echo "Build complete, contents of dist-manifest.json:"
146+ cat dist-manifest.json
147+
148+ # Upload to release
149+ cat dist-manifest.json | jq --raw-output ".artifacts[]?.path | select( . != null )" > uploads.txt
150+ echo "uploading..."
151+ cat uploads.txt
152+ gh release upload ${{ github.ref_name }} $(cat uploads.txt)
153+ echo "uploaded!"
128154
129155 # Mark the Github Release™ as a non-draft now that everything has succeeded!
130156 publish-release :
0 commit comments