Skip to content

Add new functions: NewStreamWriter, SetRow and Flush #25

Add new functions: NewStreamWriter, SetRow and Flush

Add new functions: NewStreamWriter, SetRow and Flush #25

Workflow file for this run

on: [push, pull_request, release]
name: build
permissions:
contents: read
pull-requests: write
jobs:
test:
strategy:
matrix:
go-version: [1.25.x]
os: [ubuntu-24.04, macos-latest, windows-latest]
targetplatform: [x64]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache: false
- name: Checkout code
uses: actions/checkout@v5
- name: Checkout excelize-py
uses: actions/checkout@v5
with:
repository: xuri/excelize-py
path: excelize-py
- name: Get dependencies
run: cd excelize-py && env GO111MODULE=on go vet ./...
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.x
7.x
8.x
9.x
- name: Test on Windows
env:
CGO_ENABLED: 1
if: matrix.os == 'windows-latest'
run: |
cd excelize-py
go build -buildmode=c-shared -o ..\Excelize\libexcelize.amd64.windows.dll main.go
cd ..\Excelize
dotnet restore && dotnet build -c Release
cd ..\Excelize.Tests
dotnet restore && dotnet test --collect:"XPlat Code Coverage" --results-directory .
- name: Test on Linux
env:
CGO_ENABLED: 1
if: matrix.os == 'ubuntu-24.04'
run: |
cd excelize-py
go build -buildmode=c-shared -o ../Excelize/libexcelize.amd64.linux.so main.go
cd ../Excelize
dotnet restore && dotnet build -c Release
cd ../Excelize.Tests
dotnet restore && dotnet test --collect:"XPlat Code Coverage" --results-directory .
- name: Test on macOS
env:
CGO_ENABLED: 1
if: matrix.os == 'macos-latest'
run: |
cd excelize-py
go build -buildmode=c-shared -o ../Excelize/libexcelize.arm64.darwin.dylib main.go
cd ../Excelize
dotnet restore && dotnet build -c Release
cd ../Excelize.Tests
dotnet restore && dotnet test --collect:"XPlat Code Coverage" --results-directory .
- name: Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: .
flags: unittests
name: codecov-umbrella
build:
runs-on: ${{ matrix.os }}
needs: [test]
if: github.event_name == 'release' && github.event.action == 'published'
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-latest]
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: 1.25.x
cache: false
- name: Checkout excelize-py
uses: actions/checkout@v5
with:
repository: xuri/excelize-py
path: .
- name: Get dependencies
run: env GO111MODULE=on go vet ./...
- name: Build Linux Shared Library
if: matrix.os == 'ubuntu-24.04'
env:
CGO_ENABLED: 1
run: |
docker run --rm -v $PWD:/src -w /src quay.io/pypa/manylinux2014_x86_64 bash -c "
yum install -y wget || true
wget https://go.dev/dl/go1.25.3.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.25.3.linux-amd64.tar.gz && \
export PATH=/usr/local/go/bin:\$PATH && \
CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=amd64 \
go build -buildmode=c-shared -ldflags='-s -w' -trimpath \
-o libexcelize.amd64.linux.so main.go && \
rm -f libexcelize.*.h
"
docker run --rm -v $PWD:/src -w /src quay.io/pypa/manylinux2014_i686 bash -c "
yum install -y wget || true
wget https://go.dev/dl/go1.25.3.linux-386.tar.gz && \
tar -C /usr/local -xzf go1.25.3.linux-386.tar.gz && \
export PATH=/usr/local/go/bin:\$PATH && \
CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=386 \
go build -buildmode=c-shared -ldflags='-s -w' -trimpath \
-o libexcelize.386.linux.so main.go && \
rm -f libexcelize.*.h
"
- name: Build Linux ARM64 Shared Library
if: matrix.os == 'ubuntu-24.04-arm'
env:
CGO_ENABLED: 1
run: |
docker run --rm -v $PWD:/src -w /src quay.io/pypa/manylinux2014_aarch64 bash -c "
yum install -y wget || true
wget https://go.dev/dl/go1.25.3.linux-arm64.tar.gz && \
tar -C /usr/local -xzf go1.25.3.linux-arm64.tar.gz && \
export PATH=/usr/local/go/bin:\$PATH && \
CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=arm64 \
go build -buildmode=c-shared -ldflags='-s -w' -trimpath \
-o libexcelize.arm64.linux.so main.go && \
rm -f libexcelize.*.h
"
- name: Build Shared Library
if: matrix.os == 'macos-latest'
env:
CGO_ENABLED: 1
run: |
wget https://github.com/mstorsjo/llvm-mingw/releases/download/20251021/llvm-mingw-20251021-ucrt-macos-universal.tar.xz
tar -xzf llvm-mingw-20251021-ucrt-macos-universal.tar.xz
export PATH="$(pwd)/llvm-mingw-20251021-ucrt-macos-universal/bin:$PATH"
CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -buildmode=c-shared -trimpath -o libexcelize.amd64.windows.dll main.go
CC=i686-w64-mingw32-gcc GOOS=windows GOARCH=386 go build -ldflags "-s -w" -buildmode=c-shared -trimpath -o libexcelize.386.windows.dll main.go
CC=aarch64-w64-mingw32-gcc GOOS=windows GOARCH=arm64 go build -ldflags "-s -w" -buildmode=c-shared -trimpath -o libexcelize.arm64.windows.dll main.go
CC=gcc GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -buildmode=c-shared -trimpath -o libexcelize.arm64.darwin.dylib main.go
CC=gcc GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -buildmode=c-shared -trimpath -o libexcelize.amd64.darwin.dylib main.go
rm -f libexcelize.*.h
- name: Upload Linux Artifacts
if: matrix.os == 'ubuntu-24.04'
uses: actions/upload-artifact@v4
with:
name: linux-artifacts
path: |
libexcelize.386.linux.so
libexcelize.amd64.linux.so
- name: Upload Linux ARM64 Artifacts
if: matrix.os == 'ubuntu-24.04-arm'
uses: actions/upload-artifact@v4
with:
name: linux-arm64-artifacts
path: |
libexcelize.arm64.linux.so
- name: Upload Darwin Artifacts
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: darwin-artifacts
path: |
libexcelize.amd64.windows.dll
libexcelize.386.windows.dll
libexcelize.arm64.windows.dll
libexcelize.arm64.darwin.dylib
libexcelize.amd64.darwin.dylib
publish:
runs-on: ubuntu-latest
needs: [build]
permissions:
packages: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.x
7.x
8.x
9.x
- name: Download Artifacts
uses: actions/download-artifact@v5
with:
merge-multiple: true
path: ./Excelize
- name: Install dotnet-validate
run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.537
- name: Pack and Publish Package
run: |
cd Excelize
dotnet build -c Release && dotnet pack -c Release
dotnet-validate package local ./bin/ExcelizeCs*.nupkg
dotnet nuget push ./bin/ExcelizeCs*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
dotnet nuget push ./bin/ExcelizeCs*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --skip-duplicate