Skip to content

Commit 0187dd2

Browse files
authored
trying win-x86 (#24)
* trying win-x86 * split pipeline * yeah right * restructuring tests * invoke ctest * x86 is back * no snappy? * ctest from build folder * no snappy * try this folder * test env * another env test * non existing var * playing with env * typo * what about his * this * test run condition * oops * oops typo * oops * tests * zstd conditional * ffffff * simplify the project * dunno * quick cleanup * Windows workaround * simplification * try it again phew * like this? * ohhh * collect notes * artifact collection * use iron_is_supported new export * artifact options * 1 * 1
1 parent c7a6ca5 commit 0187dd2

File tree

14 files changed

+255
-173
lines changed

14 files changed

+255
-173
lines changed

.github/workflows/full.yml renamed to .github/workflows/build.yml

Lines changed: 46 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
name: 'Full Flow'
1+
name: 'Build'
22

33
env:
4-
VERSION: 1.6.0
5-
# PACKAGE_SUFFIX: '-pre.1'
6-
PACKAGE_SUFFIX: ''
4+
VERSION: 1.6.1
5+
PACKAGE_SUFFIX: '-pre.1'
6+
# PACKAGE_SUFFIX: ''
77
ASM_VERSION: 1.0.0
88
BUILD_TYPE: Release
99
VCPKG_HASH: 0f88ecb8528605f91980b90a2c5bad88e3cb565f
10-
# Indicates the location of the vcpkg as a Git submodule of the project repository.
11-
#VCPKG_ROOT: ${{ github.workspace }}/vcpkg
12-
# Tells vcpkg where binary packages are stored.
13-
# VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/bincache
1410

1511
on:
1612
push:
@@ -40,54 +36,50 @@ jobs:
4036
vcpkg_triplet: arm64-linux
4137
vcpkg_config: RelWithDebInfo
4238
dotnet_rid: linux-arm64
39+
no_native_tests: true
40+
cmake_options: -D CMAKE_SYSTEM_PROCESSOR=aarch64 -D CMAKE_C_COMPILER=$(which aarch64-linux-gnu-gcc) -D CMAKE_CXX_COMPILER=$(which aarch64-linux-gnu-g++)
4341
- os: windows-latest
4442
arch: x64
4543
vcpkg_triplet: x64-windows-static
4644
vcpkg_config: Release
4745
dotnet_rid: win-x64
46+
# Still can't make this build
47+
# - os: windows-latest
48+
# arch: x86
49+
# vcpkg_triplet: x86-windows-static
50+
# vcpkg_config: Release
51+
# dotnet_rid: win-x86
52+
# cmake_options: -D CMAKE_GENERATOR_PLATFORM=x86
4853
- os: macos-latest
4954
arch: arm64
5055
vcpkg_triplet: arm64-osx
5156
vcpkg_config: RelWithDebInfo
5257
dotnet_rid: osx-arm64
58+
cmake_options: -D CMAKE_OSX_ARCHITECTURES=arm64
5359

5460
fail-fast: false
5561
name: 'build: ${{ matrix.os }} (${{ matrix.arch }})'
5662

63+
env:
64+
VCPKG_DEFAULT_VCPKG_TRIPLET: ${{ matrix.vcpkg_triplet }}
65+
VCPKG_TRIPLET: ${{ matrix.vcpkg_triplet }}
66+
VCPKG_CONFIG: ${{ matrix.vcpkg_config }}
67+
DOTNET_RID: ${{ matrix.dotnet_rid }}
68+
NO_NATIVE_SNAPPY: ${{ matrix.no_native_snappy }}
69+
NO_NATIVE_ZSTD: ${{ matrix.no_native_zstd }}
70+
CMAKE_OPTIONS: ${{ matrix.cmake_options }}
71+
5772
steps:
5873

5974
- uses: actions/checkout@v4
6075
with:
6176
submodules: true
6277

63-
- name: env (windows)
64-
if: runner.os == 'Windows'
65-
run: |
66-
echo "VCPKG_DEFAULT_VCPKG_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $env:GITHUB_ENV
67-
echo "VCPKG_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $env:GITHUB_ENV
68-
echo "VCPKG_CONFIG=${{ matrix.vcpkg_config }}" >> $env:GITHUB_ENV
69-
echo "DOTNET_RID=${{ matrix.dotnet_rid }}" >> $env:GITHUB_ENV
70-
71-
- name: env
72-
if: runner.os == 'Linux' || runner.os == 'macOS'
73-
run: |
74-
echo "VCPKG_DEFAULT_VCPKG_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
75-
echo "VCPKG_TRIPLET=${{ matrix.vcpkg_triplet }}" >> $GITHUB_ENV
76-
echo "VCPKG_CONFIG=${{ matrix.vcpkg_config }}" >> $GITHUB_ENV
77-
echo "DOTNET_RID=${{ matrix.dotnet_rid }}" >> $GITHUB_ENV
78-
7978
- name: Linux ARM
8079
if: runner.os == 'Linux' && matrix.arch == 'arm64'
8180
run: |
8281
sudo apt-get update
8382
sudo apt-get --yes install g++-aarch64-linux-gnu pkg-config-aarch64-linux-gnu
84-
echo "CMAKE_OPTIONS=-D CMAKE_SYSTEM_PROCESSOR=aarch64 -D CMAKE_C_COMPILER=$(which aarch64-linux-gnu-gcc) -D CMAKE_CXX_COMPILER=$(which aarch64-linux-gnu-g++)" >> $GITHUB_ENV
85-
echo "SUPPRESS_TEST=1" >> $GITHUB_ENV
86-
87-
- name: OSX M1
88-
if: runner.os == 'macOS' && matrix.arch == 'arm64'
89-
run: |
90-
echo "CMAKE_OPTIONS=-D CMAKE_OSX_ARCHITECTURES=arm64" >> $GITHUB_ENV
9183
9284
- uses: friendlyanon/setup-vcpkg@v1
9385
# seems like the absense of commit hash expects vcpkg submodule, i don't want that
@@ -96,10 +88,6 @@ jobs:
9688
# set to false to clear any cache in case of build errors
9789
cache: false
9890

99-
# - name: show cmake config
100-
# run: cmake -h
101-
# working-directory: native
102-
10391
- name: configure
10492
run: cmake -B build -S . -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -D "CMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" -D "VCPKG_TARGET_TRIPLET=${{ env.VCPKG_TRIPLET }}" ${{ env.CMAKE_OPTIONS }}
10593
working-directory: native
@@ -110,7 +98,20 @@ jobs:
11098

11199
- name: debug
112100
run: ls -R
113-
working-directory: native
101+
working-directory: native/build
102+
103+
- name: test
104+
if: runner.os != 'Windows' && !matrix.no_native_tests
105+
run: ctest
106+
working-directory: native/build
107+
108+
- name: test (windows .exe)
109+
if: runner.os == 'Windows' && !matrix.no_native_tests
110+
run: |
111+
ls -R
112+
pwd
113+
.\tests.exe
114+
working-directory: native/build/Release
114115

115116
- uses: actions/upload-artifact@v4
116117
name: Collect Artifacts
@@ -139,7 +140,9 @@ jobs:
139140
- uses: actions/upload-artifact@v4
140141
name: Collect Artifacts
141142
with:
142-
name: native
143+
name: native-fat
144+
compression-level: 9
145+
if-no-files-found: error
143146
path: |
144147
native/ubin/**/*
145148
@@ -172,7 +175,7 @@ jobs:
172175

173176
- uses: actions/download-artifact@v4
174177
with:
175-
name: native
178+
name: native-fat
176179
path: native/ubin/
177180

178181
- name: debug1
@@ -207,7 +210,7 @@ jobs:
207210

208211
- uses: actions/download-artifact@v4
209212
with:
210-
name: native
213+
name: native-fat
211214
path: native/ubin/
212215

213216
- name: debug
@@ -228,30 +231,8 @@ jobs:
228231
name: Collect Artifacts
229232
with:
230233
name: managed
234+
compression-level: 9
235+
if-no-files-found: error
231236
path: |
232-
managed/IronCompress/bin/Release/*
233-
234-
publish:
235-
needs: [test-managed, build-managed]
236-
runs-on: ubuntu-latest
237-
if: github.ref == 'refs/heads/master'
238-
environment: nuget
239-
steps:
240-
241-
- uses: actions/download-artifact@v4
242-
with:
243-
name: managed
244-
path: pub/managed/
245-
246-
- name: push to nuget.org
247-
run: dotnet nuget push pub/managed/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
248-
249-
- name: create gh release
250-
uses: softprops/action-gh-release@v1
251-
if: github.ref == 'refs/heads/master'
252-
with:
253-
tag_name: ${{ env.VERSION }}
254-
name: ${{ env.VERSION }}
255-
files: "pub/managed/*.nupkg"
256-
generate_release_notes: true
257-
237+
managed/IronCompress/bin/Release/**/*nupkg
238+
docs/release-notes.md

.github/workflows/prerelease.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 'PRE-release'
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
if: github.ref == 'refs/heads/master'
10+
11+
steps:
12+
13+
- name: Get latest run ID
14+
id: runid
15+
run: |
16+
run_id=$(curl --request GET \
17+
--url https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yml/runs \
18+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
19+
| jq '.workflow_runs[] | select(.status=="completed") | .id' | head -1)
20+
echo "::set-output name=run-id::$run_id"
21+
22+
- name: ⬇️ Download binary output from build.yml
23+
uses: actions/download-artifact@v4
24+
with:
25+
name: managed
26+
path: managed
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
run-id: ${{ steps.runid.outputs.run-id }}
29+
30+
- name: debug
31+
run: ls -R
32+
33+
- name: 🔢 prep release notes
34+
run: |
35+
grep -m 2 -B 1000 '^## ' docs/release-notes.md | tail -n +3 | head -n -2 > final_notes.md
36+
cat final_notes.md
37+
38+
# - name: 📦 Publish to NuGet
39+
# run: dotnet nuget push managed/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
40+
41+
# - name: create gh release
42+
# uses: softprops/action-gh-release@v1
43+
# if: github.ref == 'refs/heads/master'
44+
# with:
45+
# tag_name: ${{ env.VERSION }}
46+
# name: ${{ env.VERSION }}
47+
# files: "pub/managed/*.nupkg"
48+
# generate_release_notes: true
49+

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Release'
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
if: github.ref == 'refs/heads/master'
10+
11+
steps:
12+
13+
- name: Get latest run ID
14+
id: runid
15+
run: |
16+
run_id=$(curl --request GET \
17+
--url https://api.github.com/repos/${{ github.repository }}/actions/workflows/build.yml/runs \
18+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
19+
| jq '.workflow_runs[] | select(.status=="completed") | .id' | head -1)
20+
echo "::set-output name=run-id::$run_id"
21+
22+
- name: ⬇️ Download binary output from build.yml
23+
uses: actions/download-artifact@v4
24+
with:
25+
name: managed
26+
path: managed
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
run-id: ${{ steps.runid.outputs.run-id }}
29+
30+
- name: debug
31+
run: ls -R

docs/release-notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 1.6.1
2+
3+
Mostly stability improvements

managed/IronCompress.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IronCompress.Test", "IronCo
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E019ACDF-9076-45D4-AD1B-702285BD178D}"
1111
ProjectSection(SolutionItems) = preProject
12-
..\.github\workflows\full.yml = ..\.github\workflows\full.yml
12+
..\.github\workflows\build.yml = ..\.github\workflows\build.yml
13+
..\.github\workflows\prerelease.yml = ..\.github\workflows\prerelease.yml
1314
..\docs\README.md = ..\docs\README.md
15+
..\.github\workflows\release.yml = ..\.github\workflows\release.yml
16+
..\docs\release-notes.md = ..\docs\release-notes.md
1417
EndProjectSection
1518
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IronCompress.Benchmarks", "IronCompress.Benchmarks\IronCompress.Benchmarks.csproj", "{FB951E3A-3B24-4BB3-89D0-23B4E6013C86}"
19+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IronCompress.Benchmarks", "IronCompress.Benchmarks\IronCompress.Benchmarks.csproj", "{FB951E3A-3B24-4BB3-89D0-23B4E6013C86}"
1720
EndProject
1821
Global
1922
GlobalSection(SolutionConfigurationPlatforms) = preSolution

managed/IronCompress/Iron.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ static bool SupportsManaged(Codec c) {
4444
}
4545

4646
static bool SupportsNative(Codec c) {
47-
//return IsNativeLibraryAvailable && c != Codec.Gzip;
48-
return true;
47+
return Native.iron_is_supported((int)c);
4948
}
5049

5150
/// <summary>

managed/IronCompress/Native.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@ internal static extern unsafe bool iron_compress(bool compress,
4848

4949
[DllImport(LibName)]
5050
internal static extern bool iron_ping();
51+
52+
[DllImport(LibName)]
53+
internal static extern bool iron_is_supported(int codec);
5154
}
5255
}

0 commit comments

Comments
 (0)