Skip to content

Commit 29255c5

Browse files
authored
Prepare for v4.3.0-beta1. (#823)
Many small things including: * Update release notes. * Update pyktx README.md with note about macOS build warning. * Fix many small issues with pyktx deployment. * Fix pyktx version number to include normalized tweak. * Add tweak to version number in Android package names. * Fix typo in example in documentation. * Fix Emscripten build to meet new requirement to enable GetProcAddress via compile option. * Fix #851: image corruption on loading. * Prepare for publishing pyktx to PyPI.
1 parent d3ef5ed commit 29255c5

24 files changed

Lines changed: 345 additions & 117 deletions
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Copyright 2023 Shukant Pal
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Publish Python 🐍 distribution 📦 to PyPI or TestPyPI
5+
6+
# https://github.com/pypa/gh-action-pypi-publish strongly recommends a
7+
# separate publishing job when building platform-specific distribution
8+
# packages, hence this.
9+
#
10+
# This should not be run until the release artifacts have been deployed.
11+
# The only way I can see to trigger this automatically is to have all
12+
# platform builds in a single workflow file and use on: `workflow_run`
13+
# so this is triggered when that workflow completes. Once all platform
14+
# builds are moved to GitHub Actions we can try making each platform
15+
# workflow reusable and making another workflow that calls each of
16+
# them via `uses` and use `on: workflow_run` here.
17+
#
18+
# We also have to figure out how to determine if the workflow deployed
19+
# to releases. Maybe can use the GitHub REST API to get an artifact
20+
# from the triggering workflow that is set only when deploying
21+
# releases. See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow.
22+
# Alternatively maybe there is some way of querying what triggered
23+
# the workflow that we can test in an `if:` in the job as noted below.
24+
25+
on:
26+
workflow_dispatch:
27+
inputs:
28+
# repository-url:
29+
# description: 'destination repository'
30+
# required: true
31+
# default: 'https://pypi.org'
32+
# type: choice
33+
# options:
34+
# - https://test.pypi.org
35+
# - https://pypi.org
36+
test-pypi:
37+
type: boolean
38+
description: 'Deploy to test pypi registry'
39+
required: true
40+
default: false
41+
42+
# Example to try in future.
43+
# workflow_run:
44+
# workflows: [KTX-Software Build All]
45+
# types:
46+
# - completed
47+
# An unknown is how to limit the trigger to when deploy is run in
48+
# Windows CI which is happens when that workflow is triggered by
49+
# a push with the tags below.
50+
# push:
51+
# # Trigger on push of release tags. There is no way to limit the trigger
52+
# # to a specific branch. A later build step checks for the main branch.
53+
# tags:
54+
# - 'v[0-9]+\.[0-9]+\.[0-9]+'
55+
# - 'v[0-9]+\.[0-9]+\.[0-9]+-*'
56+
57+
jobs:
58+
publish-to-pypi:
59+
name: Publish Python 🐍 distribution 📦 to PyPI
60+
if: test-pypi == false
61+
runs-on: ubuntu-latest
62+
environment:
63+
name: pypi
64+
url: https://pypi.org/p/pyktx
65+
permissions:
66+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
67+
# When using workflow_run it is necessary to check for successful
68+
# completion of the workflow with
69+
#if: ${{ github.event.workflow_run.conclusion == 'success' }}
70+
# Maybe it is possible to test for a release tag here too.
71+
steps:
72+
- name: Download latest release metadata
73+
run: |
74+
curl \
75+
-H "Accept: application/vnd.github+json" \
76+
-H "X-GitHub-Api-Version: 2022-11-28" \
77+
-o latest.json \
78+
https://api.github.com/repos/KhronosGroup/KTX-Software/releases/latest
79+
- name: Filter out pyktx- assets
80+
run: |
81+
jq '.assets | map(select(.name | startswith("pyktx-"))) | map(.browser_download_url)' < latest.json > pyktx.json
82+
- name: Create dist directory
83+
run: |
84+
mkdir dist
85+
- name: Download assets
86+
run: |
87+
cd dist; jq -c '.[]' ../pyktx.json | xargs -L 1 curl -O -J; cd..
88+
- name: Publish distribution 📦 to PyPI
89+
uses: pypa/gh-action-pypi-publish@release/v1
90+
with:
91+
password: ${{ secrets.PYPI_API_TOKEN }}
92+
93+
publish-to-testpypi:
94+
name: Publish Python 🐍 distribution 📦 to TestPyPI
95+
if: test-pypi
96+
runs-on: ubuntu-latest
97+
environment:
98+
name: testpypi
99+
url: https://pypi.org/p/pyktx
100+
permissions:
101+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
102+
# When using workflow_run it is necessary to check for successful
103+
# completion of the workflow with
104+
#if: ${{ github.event.workflow_run.conclusion == 'success' }}
105+
# Maybe it is possible to test for a release tag here too.
106+
steps:
107+
- name: Download latest release metadata
108+
run: |
109+
curl \
110+
-H "Accept: application/vnd.github+json" \
111+
-H "X-GitHub-Api-Version: 2022-11-28" \
112+
-o latest.json \
113+
https://api.github.com/repos/KhronosGroup/KTX-Software/releases/latest
114+
- name: Filter out pyktx- assets
115+
run: |
116+
jq '.assets | map(select(.name | startswith("pyktx-"))) | map(.browser_download_url)' < latest.json > pyktx.json
117+
- name: Create dist directory
118+
run: |
119+
mkdir dist
120+
- name: Download assets
121+
run: |
122+
cd dist; jq -c '.[]' ../pyktx.json | xargs -L 1 curl -O -J; cd..
123+
- name: Publish distribution 📦 to TestPyPI
124+
uses: pypa/gh-action-pypi-publish@release/v1
125+
with:
126+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/publish.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/windows.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ jobs:
225225
# is spawned from some parent Powershell so it does not pick up
226226
# the changes from the registry. Use Chocolatey's helper to
227227
# pull in the changes.
228-
# After import `refreshenv` is an alias for
228+
# After import, `refreshenv` is an alias for
229229
# Update-SessionEnvironment. Without the import refreshenv will end
230230
# up calling the cmd.exe version, which won't help Powershell, and
231231
# Update-SessionEnvironment will not exist.
@@ -263,18 +263,20 @@ jobs:
263263
path: ${{env.BUILD_DIR}}/KTX-Software-*.exe*
264264

265265
- name: Upload pyktx artifacts
266-
if: matrix.options.package == 'YES' && matrix.options.py
266+
if: matrix.options.package == 'YES' && matrix.options.py == 'ON'
267267
uses: kittaakos/upload-artifact-as-is@v0
268268
with:
269269
path: ${{env.BUILD_DIR}}/interface/python_binding/dist/
270270

271-
- name: Upload To Release
271+
- name: Upload to Release
272272
uses: softprops/action-gh-release@v1
273273
if: matrix.options.package == 'YES' && matrix.toolset == 'CLangCL' && github.event_name == 'push' && github.ref_type == 'tag'
274274
with:
275275
draft: true
276276
prerelease: true
277-
files: ${{env.BUILD_DIR}}/KTX-Software-*.exe*
277+
files: |
278+
${{env.BUILD_DIR}}/KTX-Software-*.exe*
279+
${{env.BUILD_DIR}}/interface/python_binding/dist/pyktx-*
278280
env:
279281
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
280282

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ cmake-build-*
5656
# Temps used for Windows signing on CI
5757
appveyor-tools
5858
the_khronos_group_inc.p12
59+
60+
# Place for random developer test files.
61+
/testground/

.travis.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,25 @@ deploy:
396396

397397
- provider: script
398398
edge: true
399-
script: ruby ci_scripts/github_release.rb -s ${GITHUB_TOKEN} -r ${TRAVIS_REPO_SLUG} -c $REL_DESC_FILE -t ${TRAVIS_TAG} --overwrite true --draft true --prerelease true $BUILD_DIR/KTX-Software-*-* $BUILD_DIR/interface/python_binding/dist/*.whl
399+
# nullglob is to force a null string when there are no *.whl files.
400+
script: ruby ci_scripts/github_release.rb -s ${GITHUB_TOKEN} -r ${TRAVIS_REPO_SLUG} -c $REL_DESC_FILE -t ${TRAVIS_TAG} --overwrite true --draft true --prerelease true $BUILD_DIR/KTX-Software-*-*
400401
on:
401402
tags: true
402403
#branch: master
403404
condition: $PACKAGE = "YES" && $TRAVIS_TAG =~ ^v[0-9].*
405+
406+
# Separate deploy for pyktx because the linux runners use sh not bash
407+
# for the "script" so `shopt -s nullglob; ci_scripts/github_release.rb ...`
408+
# does not work to avoid passing `.../*.whl` to github_release when
409+
# FEATURE_PY not ON.
410+
- provider: script
411+
edge: true
412+
script: ruby ci_scripts/github_release.rb -s ${GITHUB_TOKEN} -r ${TRAVIS_REPO_SLUG} -c $REL_DESC_FILE -t ${TRAVIS_TAG} --overwrite true --draft true --prerelease true $BUILD_DIR/interface/python_binding/dist/*.whl
413+
on:
414+
tags: true
415+
#branch: master
416+
condition: $PACKAGE = "YES" && $TRAVIS_TAG =~ ^v[0-9].* && $FEATURE_PY = "ON"
417+
404418
# ---------------------------------------------------------
405419

406420
# vim:ai:ts=4:sts=2:sw=2:expandtab

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ if(EMSCRIPTEN)
877877
"SHELL:-s EXPORT_NAME=LIBKTX"
878878
"SHELL:-s EXPORTED_RUNTIME_METHODS=[\'GL\']"
879879
"SHELL:-s GL_PREINITIALIZED_CONTEXT=1"
880+
"SHELL:-s GL_ENABLE_GET_PROC_ADDRESS=1" # For Emscripten 3.1.51+
880881
)
881882
set_target_properties( ktx_js PROPERTIES OUTPUT_NAME "libktx")
882883

RELEASE_NOTES.md

Lines changed: 97 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22
<!-- SPDX-License-Identifier: Apache-2.0 -->
33
Release Notes
44
=============
5-
## Version 4.3.0-alpha3
6-
### New Features
5+
## Version 4.3.0-beta1
6+
### New Features in Version 4.3.0
7+
#### Command Line Tools Suite
78

89
v4.3.0 contains a new suite of command line tools accessed via an umbrella `ktx` command.
910

1011
| Tool | Description | Equivalent old tool |
1112
| :--- | ----------- | ------------------- |
1213
| `ktx create` | Create a KTX2 file from various input files | `toktx` |
1314
| `ktx extract` | Export selected images from a KTX2 file | - |
14-
| `ktx encode` | Encode a KTX2 file | `ktxsc` |
15+
| `ktx encode` | Encode a KTX2 file to a Basis Universal format | `ktxsc` |
1516
| `ktx transcode` | Transcode a KTX2 file | - |
1617
| `ktx info` | Prints information about a KTX2 file | `ktxinfo` |
1718
| `ktx validate` | Validate a KTX2 file | `ktx2check` |
1819
| `ktx help` | Display help information about the ktx tools | - |
1920

20-
Equivalent old tools will be removed in the next release.
21+
Equivalent old tools will be removed in a subsequent release soon.
2122

2223
Some features of the old tools are not currently available in the new equivalent.
2324

2425
| Old Tool | New Tool | Missing Features |
2526
| :------: | :------: | ---------------- |
26-
| `toktx` | `create` | JPEG and NBPM input and scaling/resizing. |
27-
| `ktxsc` | `encode` | ASTC encoding. This can be done in `create`. |
27+
| `toktx` | `create` | JPEG and NBPM input and scaling/resizing of input images. |
28+
| `ktxsc` | `encode` | ASTC encoding of a KTX2 file. This can be done in `create`. <br>Deflation of a KTX2 file with zlib or zstd.|
29+
2830

2931
The command-line syntax and semantics differ from the old tools including, but not limited to:
3032

@@ -43,12 +45,17 @@ The command-line syntax and semantics differ from the old tools including, but n
4345

4446
Please refer to the manual pages or use the `--help` command-line option for further details on the options available and associated semantics for each individual command.
4547

48+
#### Python Binding
49+
A Python binding for `libktx` has been added. Applications written in Python can now use `libktx` functions. Huge thanks to @ShukantPal. Please download the appropriate `pyktx` package from Releases as publishing to PyPI is not yet established.
50+
4651
### Changes
4752

4853
* `libktx` has been made much more robust to errors KTX files.
49-
5054
* `libktx` now validates checksums when present in a Zstd data stream.
5155
* `libktx` has two new error codes it can return: `KTX_DECOMPRESS_LENGTH_ERROR` and `KTX_DECOMPRESS_CHECKSUM_ERROR`.
56+
* All tools and `libktx` now correctly process on all platforms utf8 file names
57+
with multi-byte code-points. Previously such names did not work on Windows.
58+
* The Vulkan texture uploader can now optionally be used with an extenal memory allocator such as [VulkanMemoryAllocator](https://gpuopen.com/vulkan-memory-allocator/).
5259

5360
### Known Issues
5461

@@ -63,6 +70,89 @@ Please refer to the manual pages or use the `--help` command-line option for fur
6370
* Neither the Vulkan nor GL loaders support depth/stencil textures.
6471

6572

73+
### Changes since v4.3.0-alpha3 (by part)
74+
### libktx
75+
76+
* git subrepo push lib/dfdutils (ab9c27707) (@MarkCallow)
77+
78+
* Reenable build of loadtest apps on Windows arm64 CI (#802) (6c131f75f) (@MarkCallow)
79+
80+
* Utf-8/unicode support in legacy tools and lib. (#800) (1c5dc9cf6) (@MarkCallow)
81+
82+
* Do not redefine NOMINMAX (#801) (6dbb24643) (@corporateshark)
83+
84+
* libktx: update ktxTexture2\_setImageFromStream to allow setting the entire level's data in one call (#794) (88fc7a6e9) (@AlexRouSg)
85+
86+
* Update dfdutils-included vulkan\_core.h. (#783) (9c223d950) (@MarkCallow)
87+
88+
* Support for A8 and A1B5G5R5 formats (#785) (eeac6206c) (@aqnuep)
89+
90+
* Major non-content documentation fixes. (#773) (e6a6a3be9) (@MarkCallow)
91+
92+
* Fix vendor-specific/tied memory property flag detection (#771) (a10021758) (@toomuchvoltage)
93+
94+
* Return KTX\_NOT\_FOUND when a GPU proc is not found. (#770) (aeca5e695) (@MarkCallow)
95+
96+
* Support for external allocators: (#748) (6856fdb0d) (@toomuchvoltage)
97+
98+
* Fix ktx\_strncasecmp (#741) (1ae04f897) (@VaderY)
99+
100+
* Use correct counter for indexing sample. (#739) (3153e94e8) (@MarkCallow)
101+
102+
### Tools
103+
104+
* Disallow ASTC options when format is not ASTC (#809) (d3ef5ed8b) (@aqnuep)
105+
106+
* Remove unnecessary nullptr checks. (#807) (072a4eb25) (@MarkCallow)
107+
108+
* Set tools and tests rpath on Linux. (#804) (928612a71) (@MarkCallow)
109+
110+
* Utf-8/unicode support in legacy tools and lib. (#800) (1c5dc9cf6) (@MarkCallow)
111+
112+
* Support building of loadtest apps with locally installed dependencies (#799) (84ee59dd2) (@MarkCallow)
113+
114+
* Update dfdutils-included vulkan\_core.h. (#783) (9c223d950) (@MarkCallow)
115+
116+
* Add UTF-8 filename support on Windows to ktxtools (#788) (7b6eab5dc) (@aqnuep)
117+
118+
* Support for A8 and A1B5G5R5 formats (#785) (eeac6206c) (@aqnuep)
119+
120+
* KTXwriterScParams support (#779) (f8691ff05) (@aqnuep)
121+
122+
* Use \-- in doc. to get -- not n-dash in output. (#767) (724790094) (@MarkCallow)
123+
124+
* Document convert\_primaries option in toktx. (#765) (3049f5b5e) (@MarkCallow)
125+
126+
* Do target\_type changes only in toktx (#757) (2cf053c19) (@MarkCallow)
127+
128+
* Add support for fewer components in input files (#755) (adcccf152) (@aqnuep)
129+
130+
* Fix --convert-primaries (#753) (e437ec45f) (@aqnuep)
131+
132+
* Fix legacy app input from pipes on Windows. (#749) (3e7fd0af6) (@MarkCallow)
133+
134+
* Improve output determinism and add internal ktxdiff tool for comparing test outputs (#745) (7f67af7e0) (@VaderY)
135+
136+
* Add KTX\_WERROR config option (#746) (dab32db90) (@MarkCallow)
137+
138+
* Fix incorrect index calculations in image conversions (#735) (682f456de) (@VaderY)
139+
140+
* Color-space and documentation related improvements for ktx create (#732) (8b12216f7) (@VaderY)
141+
142+
143+
144+
145+
146+
### Java Wrapper
147+
148+
* Update dfdutils-included vulkan\_core.h. (#783) (9c223d950) (@MarkCallow)
149+
150+
151+
152+
153+
## Version 4.3.0-alpha3
154+
155+
66156
### Changes since v4.3.0-alpha2 (by part)
67157
### libktx
68158

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ function( create_version_header dest_path target )
197197
endfunction()
198198

199199
function( create_version_file )
200-
file(WRITE ${PROJECT_BINARY_DIR}/ktx.version "${KTX_VERSION}")
200+
file(WRITE ${PROJECT_BINARY_DIR}/ktx.version "${KTX_VERSION_FULL}")
201201
endfunction()
202202

203203
# vim:ai:ts=4:sts=4:sw=2:expandtab:textwidth=70

0 commit comments

Comments
 (0)