Skip to content

Commit

Permalink
Merge pull request #13 from oceanprotocol/issue11-add-windows-support
Browse files Browse the repository at this point in the history
Update release workflow
  • Loading branch information
trizin authored Oct 23, 2023
2 parents 820e0e6 + f20f466 commit 0e1b5ca
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- goos: darwin
goarch: amd64
ext: '.dylib'
CC: o64-clang
CXX: o64-clang++

- goos: linux
goarch: amd64
Expand All @@ -27,29 +25,30 @@ jobs:
- goos: darwin
goarch: arm64
ext: '.dylib'
CC: oa64-clang
CXX: oa64-clang++

- goos: linux
goarch: arm64
ext: '.so'
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++

- goos: windows
goarch: amd64
ext: '.dll'
os: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.21'

- name: Setup osxcross (for darwin builds only)
if: matrix.goos == 'darwin'
uses: mbround18/setup-osxcross@v1
with:
osx-version: "11.3"
- name: Setup msbuild
if: matrix.goos == 'windows'
uses: microsoft/[email protected]

- name: Install aarch64-linux-gnu-gcc (for linux/arm64 builds only)
if: matrix.goos == 'linux' && matrix.goarch == 'arm64'
Expand Down Expand Up @@ -106,6 +105,12 @@ jobs:
with:
name: sapphirewrapper-linux-arm64
path: ./bin/

- name: Download built library - Windows amd64
uses: actions/download-artifact@v2
with:
name: sapphirewrapper-windows-amd64
path: ./bin/

- name: Create Release
id: create_release
Expand Down Expand Up @@ -162,6 +167,18 @@ jobs:
asset_name: sapphirewrapper-darwin-arm64.dylib
asset_content_type: application/octet-stream

- name: Upload Release Asset - Windows amd64
id: upload-release-asset-windows-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/sapphirewrapper-amd64.dll
asset_name: sapphirewrapper-windows-amd64.dll
asset_content_type: application/octet-stream


- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ jobs:
pip install web3
pip install .
- name: Wait for 60 seconds
- name: Wait for 30 seconds
run: sleep 30
if: matrix.os == 'macos-latest'

- name: Wait for 60 seconds
- name: Wait for 30 seconds
run: sleep 30
if: matrix.arch == 'arm64'

Expand Down

0 comments on commit 0e1b5ca

Please sign in to comment.