mirror of
https://github.com/italicsjenga/ash-molten.git
synced 2024-12-23 05:11:31 +11:00
Prepare release (#74)
* Fix README * Fail build if target is incorrect * Add CHANGELOG * Add release.toml * Cleanup CI
This commit is contained in:
parent
719c7cd4c3
commit
aaff4622fa
35
.github/workflows/ci.yaml
vendored
35
.github/workflows/ci.yaml
vendored
|
@ -4,6 +4,10 @@ on:
|
|||
- main
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
name: CI
|
||||
jobs:
|
||||
lint:
|
||||
|
@ -12,23 +16,22 @@ jobs:
|
|||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_12.5.app
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: "clippy, rustfmt"
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
# make sure all code has been formatted with rustfmt
|
||||
- run: rustup component add rustfmt
|
||||
- run: cargo fmt --all -- --check --color always
|
||||
# run clippy to verify we have no warnings
|
||||
- run: rustup component add clippy
|
||||
- run: cargo fetch --target x86_64-apple-darwin
|
||||
- run: cargo clippy --features pre-built -- -D warnings
|
||||
|
||||
cargo-deny:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- uses: EmbarkStudios/cargo-deny-action@v1
|
||||
|
||||
test-source:
|
||||
|
@ -37,11 +40,9 @@ jobs:
|
|||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_12.5.app
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo fetch --target x86_64-apple-darwin
|
||||
- run: cargo build
|
||||
|
||||
|
@ -51,10 +52,8 @@ jobs:
|
|||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_12.5.app
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo fetch --target x86_64-apple-darwin
|
||||
- run: cargo build --verbose --features pre-built
|
||||
|
|
55
CHANGELOG.md
Normal file
55
CHANGELOG.md
Normal file
|
@ -0,0 +1,55 @@
|
|||
<!-- markdownlint-disable blanks-around-headings blanks-around-lists no-duplicate-heading -->
|
||||
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
<!-- next-header -->
|
||||
## [Unreleased] - ReleaseDate
|
||||
### Added
|
||||
- [PR#73](https://github.com/EmbarkStudios/ash-molten/pull/73) added the `v1_1_10` and `v1_1_5` features, enabling one of these features will download or compile that version of MoltenVK instead of the version that is hardcoded in the current build script. This can be useful if a newer version of this crate uses a newer version of MoltenVK, but you want to use an older version due to reasons such as bugs or other problems with the newer version.
|
||||
|
||||
### Fixed
|
||||
- [PR#73](https://github.com/EmbarkStudios/ash-molten/pull/73) changed the build script so that `ash-molten` can be cross-compiled from non-macOS hosts, at least in the pre-compiled case, the compiled case is untested.
|
||||
- [PR#74](https://github.com/EmbarkStudios/ash-molten/pull/74) resolved [#70](https://github.com/EmbarkStudios/ash-molten/issues/70) by making the build script fail if the target os is not `macos` or `ios`.
|
||||
|
||||
## [0.13.1] - 2022-10-04
|
||||
### Changed
|
||||
- Expanded ash version range up to 0.37
|
||||
|
||||
## [0.13.0] - 2022-06-08
|
||||
### Changed
|
||||
- Update to MoltenVK 1.1.10
|
||||
|
||||
## [0.11.0] - 2021-10-14
|
||||
### Added
|
||||
- Provide entrypoint through Ash loader
|
||||
|
||||
## [0.10.0] - 2021-08-31
|
||||
### Changed
|
||||
- Update to MoltenVK 1.1.5
|
||||
- Other stuff no one bothered to write in a CHANGELOG
|
||||
|
||||
## [0.7.2] - 2020-11-13
|
||||
### Added
|
||||
- Added prebuilt libs
|
||||
|
||||
## [0.7.1] - 2020-11-10
|
||||
### Fixed
|
||||
- Disabled debug build of MoltenVK
|
||||
|
||||
## [0.7.0] - 2020-11-09
|
||||
### Changed
|
||||
- Update to MoltenVK 1.1.0
|
||||
|
||||
<!-- next-url -->
|
||||
[Unreleased]: https://github.com/EmbarkStudios/cargo-deny/compare/v0.13.1+1.1.10...HEAD
|
||||
[0.13.1]: https://github.com/EmbarkStudios/cargo-deny/compare/v0.13.0+1.1.10...v0.13.1+1.1.10
|
||||
[0.13.0]: https://github.com/EmbarkStudios/cargo-deny/compare/v0.11.0+1.1.5...v0.13.0+1.1.10
|
||||
[0.11.0]: https://github.com/EmbarkStudios/cargo-deny/compare/v0.10.0...v0.11.0+1.1.5
|
||||
[0.10.0]: https://github.com/EmbarkStudios/cargo-deny/compare/v0.7.2...v0.10.0
|
||||
[0.7.2]: https://github.com/EmbarkStudios/cargo-deny/compare/v0.7.1...v0.7.2
|
||||
[0.7.1]: https://github.com/EmbarkStudios/cargo-deny/compare/v0.7.0...v0.7.1
|
||||
[0.7.0]: https://github.com/EmbarkStudios/ash-molten/releases/tag/v0.7.0
|
66
README.md
66
README.md
|
@ -1,7 +1,14 @@
|
|||
<!-- markdownlint-disable-file MD004 -->
|
||||
<!-- markdownlint-disable-file MD034 -->
|
||||
<!-- Allow this file to not have a first line heading -->
|
||||
<!-- markdownlint-disable-file MD041 -->
|
||||
|
||||
# 🌋 ash-molten
|
||||
<!-- inline html -->
|
||||
<!-- markdownlint-disable-file MD033 -->
|
||||
|
||||
<div align="center">
|
||||
|
||||
# `🌋 ash-molten`
|
||||
|
||||
**Statically link with [MoltenVK]**
|
||||
|
||||
[![Embark](https://img.shields.io/badge/embark-open%20source-blueviolet.svg)](https://embark.dev)
|
||||
[![Embark](https://img.shields.io/badge/discord-ark-%237289da.svg?logo=discord)](https://discord.gg/dAuKfZS)
|
||||
|
@ -10,25 +17,25 @@
|
|||
[![dependency status](https://deps.rs/repo/github/EmbarkStudios/ash-molten/status.svg)](https://deps.rs/repo/github/EmbarkStudios/ash-molten)
|
||||
[![Build status](https://github.com/EmbarkStudios/ash-molten/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/ash-molten/actions)
|
||||
|
||||
`ash-molten` is built on top of [ash](https://github.com/MaikKlein/ash) and exposes a new entry point to statically link with [MoltenVK](https://github.com/KhronosGroup/MoltenVK).
|
||||
</div>
|
||||
|
||||
`ash-molten` is built on top of [ash] and exposes a new entry point to statically link with [MoltenVK].
|
||||
|
||||
Requires Xcode 12 and Mac OS 10.15 (Catalina) to compile.
|
||||
|
||||
## Why?
|
||||
|
||||
* You want to compile down to a single binary that doesn't need any environment variables to bet set.
|
||||
|
||||
* You just want to try out [MoltenVK](https://github.com/KhronosGroup/MoltenVK) without needing to setup the SDK.
|
||||
* You just want to try out [MoltenVK] without needing to setup the SDK.
|
||||
|
||||
## Why not?
|
||||
|
||||
* [ash](https://github.com/MaikKlein/ash) already supports [MoltenVK](https://github.com/KhronosGroup/MoltenVK) via runtime linking. Runtime linking is the preferred way of using Vulkan because the loader can be updated at anytime without needing to recompile.
|
||||
|
||||
* [ash] already supports [MoltenVK] via runtime linking. Runtime linking is the preferred way of using Vulkan because the loader can be updated at anytime without needing to recompile.
|
||||
* `ash-molten` doesn't have access to the validation layers and therefore can not output any debug information.
|
||||
|
||||
## How?
|
||||
|
||||
```Rust
|
||||
```rust
|
||||
let entry = ash_molten::MoltenEntry::load().expect("Unable to load Molten");
|
||||
let app_name = CString::new("Hello Static Molten").unwrap();
|
||||
|
||||
|
@ -49,41 +56,41 @@ You can run the example with `cargo run`.
|
|||
|
||||
## How does it work?
|
||||
|
||||
`ash-molten` links statically with [MoltenVK](https://github.com/KhronosGroup/MoltenVK), it then uses `vkGetInstanceProcAddr` to resolve all the function pointers at runtime.
|
||||
`ash-molten` links statically with [MoltenVK], it then uses `vkGetInstanceProcAddr` to resolve all the function pointers at runtime.
|
||||
|
||||
### Features
|
||||
|
||||
`cargo build` will clone a specific release of [MoltenVK](https://github.com/KhronosGroup/MoltenVK) compile and statically link it with your application.
|
||||
`cargo build` will clone a specific release of [MoltenVK] compile and statically link it with your application.
|
||||
`cargo build --features pre-built` will download a pre-built version of MoltenVK from a release of ash-molten.
|
||||
`cargo build --features external` provide own MoltenVK library.
|
||||
|
||||
If you want to compile [MoltenVK](https://github.com/KhronosGroup/MoltenVK) yourself, you can use the `external` feature. `cargo build --features external` requires `libMoltenVK` to be visible (`LD_LIBRARY_PATH`).
|
||||
If you want to compile [MoltenVK] yourself, you can use the `external` feature. `cargo build --features external` requires `libMoltenVK` to be visible (`LD_LIBRARY_PATH`).
|
||||
|
||||
### How to update
|
||||
|
||||
To update the version of [MoltenVK](https://github.com/KhronosGroup/MoltenVK) uses, change the following:
|
||||
To update the version of [MoltenVK] uses, change the following:
|
||||
|
||||
- In `build.rs`, change `static VERSION = "1.1.0"` to the new [MoltenVK release](https://github.com/KhronosGroup/MoltenVK/releases) tag name
|
||||
- Update the crate version in `Cargo.toml`
|
||||
- Bump the patch version
|
||||
- Set the version metadata to the MoltenVK release.
|
||||
- E.g. `0.2.0+1.1.9` -> `0.2.1+1.1.10`.
|
||||
- Before you can submit the PR, you must also update the prebuilt version. See the next section.
|
||||
* In `build.rs`, change `static VERSION = "1.1.0"` to the new [MoltenVK release](https://github.com/KhronosGroup/MoltenVK/releases) tag name
|
||||
* Update the crate version in `Cargo.toml`
|
||||
* Bump the patch version
|
||||
* Set the version metadata to the MoltenVK release.
|
||||
* E.g. `0.2.0+1.1.9` -> `0.2.1+1.1.10`.
|
||||
* Before you can submit the PR, you must also update the prebuilt version. See the next section.
|
||||
|
||||
### Updating pre-built version
|
||||
|
||||
To update the prebuilt version of MoltenVK that ash-molten uses, change the following:
|
||||
|
||||
- Follow the steps mentioned above.
|
||||
- Download the MoltenVK XCFramework from, for example, the Vulkan SDK for Mac or build [MoltenVK](https://github.com/KhronosGroup/MoltenVK/) yourself.
|
||||
- in the case of downloading it from an external source make sure MoltenVK version matches `static VERSION`.
|
||||
- From the XCFramework folder, from the built version of MoltenVK, zip the folders of platforms that need to be supported individually.
|
||||
- Create a release with the tag: MoltenVK-{version number}.
|
||||
- Upload the zip files to the release with the MoltenVK-{version number} tag.
|
||||
* Follow the steps mentioned above.
|
||||
* Download the MoltenVK XCFramework from, for example, the Vulkan SDK for Mac or build [MoltenVK] yourself.
|
||||
* in the case of downloading it from an external source make sure MoltenVK version matches `static VERSION`.
|
||||
* From the XCFramework folder, from the built version of MoltenVK, zip the folders of platforms that need to be supported individually.
|
||||
* Create a release with the tag: MoltenVK-{version number}.
|
||||
* Upload the zip files to the release with the MoltenVK-{version number} tag.
|
||||
|
||||
## Contributing
|
||||
|
||||
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](../CODE_OF_CONDUCT.md)
|
||||
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](CODE_OF_CONDUCT.md)
|
||||
|
||||
We welcome community contributions to this project.
|
||||
|
||||
|
@ -93,8 +100,8 @@ Please read our [Contributor Guide](CONTRIBUTING.md) for more information on how
|
|||
|
||||
Licensed under either of
|
||||
|
||||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
||||
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
||||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
|
||||
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
|
||||
|
||||
at your option.
|
||||
|
||||
|
@ -104,3 +111,6 @@ Unless you explicitly state otherwise, any contribution intentionally
|
|||
submitted for inclusion in the work by you, as defined in the Apache-2.0
|
||||
license, shall be dual licensed as above, without any additional terms or
|
||||
conditions.
|
||||
|
||||
[MoltenVK]: https://github.com/KhronosGroup/MoltenVK
|
||||
[ash]: https://github.com/MaikKlein/ash
|
||||
|
|
|
@ -230,8 +230,7 @@ fn main() {
|
|||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
|
||||
if target_os != "macos" && target_os != "ios" {
|
||||
eprintln!("ash-molten requires either 'macos' or 'ios' target");
|
||||
return;
|
||||
panic!("ash-molten requires either 'macos' or 'ios' target");
|
||||
}
|
||||
|
||||
// The 'external' feature was not enabled. Molten will be built automatically.
|
||||
|
|
10
release.toml
Normal file
10
release.toml
Normal file
|
@ -0,0 +1,10 @@
|
|||
pre-release-commit-message = "Release {{version}}"
|
||||
tag-message = "Release {{version}}"
|
||||
tag-name = "{{version}}"
|
||||
pre-release-replacements = [
|
||||
{ file = "CHANGELOG.md", search = "Unreleased", replace = "{{version}}" },
|
||||
{ file = "CHANGELOG.md", search = "\\.\\.\\.HEAD", replace = "...{{tag_name}}" },
|
||||
{ file = "CHANGELOG.md", search = "ReleaseDate", replace = "{{date}}" },
|
||||
{ file = "CHANGELOG.md", search = "<!-- next-header -->", replace = "<!-- next-header -->\n## [Unreleased] - ReleaseDate" },
|
||||
{ file = "CHANGELOG.md", search = "<!-- next-url -->", replace = "<!-- next-url -->\n[Unreleased]: https://github.com/EmbarkStudios/ash-molten/compare/{{tag_name}}...HEAD" },
|
||||
]
|
Loading…
Reference in a new issue