From 7ff16b48764a9c1d1566e04234ee85c48b3b6145 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 15:48:42 +0100 Subject: [PATCH 1/8] fix(ci) Use our own LLVM built on Windows. This has been commented by error, see https://github.com/wasmerio/wasmer/pull/2008#discussion_r555588703. --- .github/workflows/main.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ca01d29e491..6a12ab24743 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -62,7 +62,7 @@ jobs: - build: windows-x64 os: windows-latest rust: 1.48 - # llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/11.x/windows-amd64.tar.gz' + llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/11.x/windows-amd64.tar.gz' artifact_name: 'wasmer-windows-amd64' cross_compilation_artifact_name: 'cross_compiled_from_win' run_integration_tests: true @@ -91,11 +91,6 @@ jobs: toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true - - name: Install LLVM (Windows) - if: matrix.os == 'windows-latest' && !matrix.llvm_url - shell: cmd - run: | - choco install llvm - name: Install LLVM (macOS Apple Silicon) if: matrix.os == 'macos-11.0' && !matrix.llvm_url run: | From 3946f3c745cd4cfb66ed13703d676096c9a13cd8 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 16:00:40 +0100 Subject: [PATCH 2/8] fix(makefile) Remove duplicated instructions. --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 07971764547..59c775ff04a 100644 --- a/Makefile +++ b/Makefile @@ -415,8 +415,6 @@ ifeq ($(OS), Windows_NT) iscc scripts/windows-installer/wasmer.iss cp scripts/windows-installer/WasmerInstaller.exe dist/ else - cp LICENSE package/LICENSE - cp ATTRIBUTIONS.md package/ATTRIBUTIONS tar -C package -zcvf wasmer.tar.gz bin lib include LICENSE ATTRIBUTIONS mv wasmer.tar.gz dist/ endif From efff2c890fcdbc275a364aa887e7cb98411cf501 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 16:04:19 +0100 Subject: [PATCH 3/8] fix(ci) Rename `wasmer-windows.exe` to `wasmer-windows-installer.exe`. --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6a12ab24743..581de29f8a9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -357,9 +357,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: artifacts/wasmer-windows-amd64/WasmerInstaller.exe - asset_name: wasmer-windows.exe + asset_name: wasmer-windows-installer.exe asset_content_type: application/vnd.microsoft.portable-executable - name: Upload Release Asset Linux amd64 id: upload-release-asset-linux-amd64 From 1a03e8875e8eb21773e3214fb77aacc06b316ffe Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 16:17:07 +0100 Subject: [PATCH 4/8] feat(makefile) Create a `wasmer.tar.gz` for Windows too. --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 59c775ff04a..9ffaa95fc02 100644 --- a/Makefile +++ b/Makefile @@ -414,10 +414,9 @@ distribution: package ifeq ($(OS), Windows_NT) iscc scripts/windows-installer/wasmer.iss cp scripts/windows-installer/WasmerInstaller.exe dist/ -else +endif tar -C package -zcvf wasmer.tar.gz bin lib include LICENSE ATTRIBUTIONS mv wasmer.tar.gz dist/ -endif ################# # Miscellaneous # From 67e8679f9612298bf21b73057beaa73dfdad727d Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 16:17:23 +0100 Subject: [PATCH 5/8] feat(github) Upload the `wasmer.tar.gz` for Windows. This patch also removes useless `id` for most steps in the `release` job. --- .github/workflows/main.yaml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 581de29f8a9..ec52e94606d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -341,6 +341,7 @@ jobs: uses: actions/download-artifact@v2 with: path: artifacts + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -351,8 +352,8 @@ jobs: release_name: Release ${{ needs.setup.outputs.VERSION }} draft: true prerelease: false - - name: Upload Release Asset Windows - id: upload-release-asset-windows + + - name: Upload Release Asset Windows Installer uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -361,8 +362,18 @@ jobs: asset_path: artifacts/wasmer-windows-amd64/WasmerInstaller.exe asset_name: wasmer-windows-installer.exe asset_content_type: application/vnd.microsoft.portable-executable + + - name: Upload Release Asset Windows + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-windows-amd64/wasmer.tar.gz + asset_name: wasmer-windows-amd64.tar.gz + asset_content_type: application/gzip + - name: Upload Release Asset Linux amd64 - id: upload-release-asset-linux-amd64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -371,8 +382,8 @@ jobs: asset_path: artifacts/wasmer-linux-amd64/wasmer.tar.gz asset_name: wasmer-linux-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Mac amd64 - id: upload-release-asset-mac-amd64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -381,8 +392,8 @@ jobs: asset_path: artifacts/wasmer-darwin-amd64/wasmer.tar.gz asset_name: wasmer-darwin-amd64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Mac arm64 - id: upload-release-asset-mac-arm64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -391,8 +402,8 @@ jobs: asset_path: artifacts/wasmer-darwin-arm64/wasmer.tar.gz asset_name: wasmer-darwin-arm64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Linux aarch64 - id: upload-release-asset-linux-aarch64 uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From cf0c56cacf2b69e6f670c0ffc389e86e156feca5 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 16:33:17 +0100 Subject: [PATCH 6/8] feat(ci) Change `wasmer.tar.gz` to `wasmer.zip` on Windows. --- .github/workflows/main.yaml | 6 +++--- Makefile | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ec52e94606d..874dec05909 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -369,9 +369,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: artifacts/wasmer-windows-amd64/wasmer.tar.gz - asset_name: wasmer-windows-amd64.tar.gz - asset_content_type: application/gzip + asset_path: artifacts/wasmer-windows-amd64/wasmer.zip + asset_name: wasmer-windows-amd64.zip + asset_content_type: application/zip - name: Upload Release Asset Linux amd64 uses: actions/upload-release-asset@v1 diff --git a/Makefile b/Makefile index 9ffaa95fc02..8319b4ab55b 100644 --- a/Makefile +++ b/Makefile @@ -414,9 +414,12 @@ distribution: package ifeq ($(OS), Windows_NT) iscc scripts/windows-installer/wasmer.iss cp scripts/windows-installer/WasmerInstaller.exe dist/ -endif + cd package && zip -r ../wasmer.zip . && cd - + mv wasmer.zip dist/ +else tar -C package -zcvf wasmer.tar.gz bin lib include LICENSE ATTRIBUTIONS mv wasmer.tar.gz dist/ +endif ################# # Miscellaneous # From 8b17f99c824808b6b7881e4b36d76eccca147ca8 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 21:26:31 +0100 Subject: [PATCH 7/8] Revert efff2c890fcdbc275a364aa887e7cb98411cf501. As @jubianchi pointed out, the `wasmer-windows.exe` file is automatically downloaded from https://github.com/wasmerio/wasmer-install/blob/7ef01146fdd7a2ae2840c27905d7d77a7d8c79ba/install.ps1#L42. We don't want to break that. Let's keep it as is. --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 874dec05909..56008a1499a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -360,7 +360,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: artifacts/wasmer-windows-amd64/WasmerInstaller.exe - asset_name: wasmer-windows-installer.exe + asset_name: wasmer-windows.exe asset_content_type: application/vnd.microsoft.portable-executable - name: Upload Release Asset Windows From a7b52b7db66bfc456703e9390d19c34951ff9aaf Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 11 Feb 2021 21:48:50 +0100 Subject: [PATCH 8/8] fix(ci) Remove `github.workspace` on Windows as it contains `\`. `github.workspace` uses `\` for the path separator. It creates confusion in Bash. This patch just uses the `.llvm` directory to contain LLVM, and use `pwd` to get an absolute path for `LLVM_SYS_110_PREFIX` and `PATH`. --- .github/workflows/main.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 56008a1499a..164e2b75a40 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -100,12 +100,13 @@ jobs: shell: bash run: | curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.llvm_url }} -L -o llvm.tar.gz - mkdir ${{ env.LLVM_DIR }} - tar xf llvm.tar.gz --strip-components=1 -C ${{ env.LLVM_DIR }} - echo "${{ env.LLVM_DIR }}/bin" >> $GITHUB_PATH - echo "LLVM_SYS_110_PREFIX=${{ env.LLVM_DIR }}" >> $GITHUB_ENV + LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} + mkdir ${LLVM_DIR} + tar xf llvm.tar.gz --strip-components=1 -C ${LLVM_DIR} + echo "${LLVM_DIR}/bin" >> $GITHUB_PATH + echo "LLVM_SYS_110_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV env: - LLVM_DIR: ${{ github.workspace }}/llvm-11 + LLVM_DIR: .llvm - name: Set up dependencies for Mac OS run: | brew install automake