Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Merge pull request #90 from steveharrington10/dogep #2

Merge pull request #90 from steveharrington10/dogep

Merge pull request #90 from steveharrington10/dogep #2

name: ios library Release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: true
matrix:
os: [macos-latest]
build_type: [Release]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '^1.23.1'
- name: Install coreutils for macOS
run: brew install coreutils
- name: Create build folder
run: |
mkdir ${{ github.workspace }}/build
mkdir ${{ github.workspace }}/build/ios_arm64
mkdir ${{ github.workspace }}/build/ios_amd64
mkdir ${{ github.workspace }}/build/ios_lib
- name: Build IOS library
run: |
chmod +x ${{ github.workspace }}/clangwrap.sh
export CGO_ENABLED=1
export GOOS=darwin
export GOARCH=amd64
export SDK=iphonesimulator
export CC=${{ github.workspace }}/clangwrap.sh
go build -buildmode=c-archive -trimpath -tags ios -o ${{ github.workspace }}/build/ios_amd64/amd64.a ${{ github.workspace }}/wasm/mobile/main.go
export GOARCH=arm64
export SDK=iphoneos
export CC=${{ github.workspace }}/clangwrap.sh
export CGO_CFLAGS="-fembed-bitcode"
go build -buildmode=c-archive -trimpath -tags ios -o ${{ github.workspace }}/build/ios_arm64/arm64.a ${{ github.workspace }}/wasm/mobile/main.go
lipo ${{ github.workspace }}/build/ios_amd64/amd64.a ${{ github.workspace }}/build/ios_arm64/arm64.a -create -output ${{ github.workspace }}/build/ios_lib/libgodp.a
cp ${{ github.workspace }}/build/ios_arm64/arm64.h ${{ github.workspace }}/build/ios_lib/libgodp.h
- name: Check Files
run: ls ${{ github.workspace }}/build/ios_lib
- name: Create Release
run: |
cd ${{ github.workspace }}/build/ios_lib && tar -czf ${{ github.workspace }}/build/ios.tar.gz .
sha256sum ${{ github.workspace }}/build/ios.tar.gz >${{ github.workspace }}/build/ios.txt
- name: Check Release Files
run: |
ls ${{ github.workspace }}/build/io*.*
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: ios-library-release
path: |
${{ github.workspace }}/build/*.*
- name: release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "build/*.gz,build/*.txt"