Skip to content

Commit f9c2dde

Browse files
committed
Administrative cleanup
1 parent 7891fc3 commit f9c2dde

17 files changed

+603
-63
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Bug Report
3+
about: ktx2 malfunctioning? Please provide a detailed bug report.
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
<!--Thank you for filing this! Please provide as much information as possible to help us diagnose and fix the issue-->
10+
11+
## Description
12+
<!--A clear and concise description of what the bug is-->
13+
14+
## Repro steps
15+
<!--A runable example or short code sample showing how to reproduce the bug-->
16+
17+
## Extra Materials
18+
<!--Anything that could help us diagnose or fix the issue-->
19+
20+
## System Information
21+
<!--Version of ktx2, information about your OS if relevant, your tech stack, etc.-->
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a way ktx2 could be better.
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Description
10+
<!--A description of what the problem is-->
11+
12+
## Proposed Solution
13+
<!--A description of what you want to happen-->
14+
15+
## Alternatives
16+
<!--Any alternative solutions or features you've considered-->
17+
18+
## Additional context
19+
<!--Add any other context about the feature request here-->

.github/ISSUE_TEMPLATE/other.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Other
3+
about: Strange things you want to tell us
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
---
8+

.github/pull_request_template.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Thank you for making a pull request! Below are the recommended steps to validate that your PR will pass CI -->
2+
3+
## Checklist
4+
5+
- [ ] `cargo clippy` reports no issues
6+
- [ ] `cargo doc` reports no issues
7+
- [ ] [`cargo deny`](https://github.com/EmbarkStudios/cargo-deny/) issues have been fixed or added to `deny.toml`
8+
- [ ] `cargo test` shows all tests passing
9+
- [ ] human-readable change descriptions added to the changelog under the "Unreleased" heading.
10+
- [ ] If the change does not affect the user (or is a process change), preface the change with "Internal:"
11+
- [ ] Add credit to yourself for each change: `Added new functionality @githubname`.
12+
13+
## Description
14+
15+
## Related Issues

.github/workflows/build.yml

+169
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
timeout-minutes: 2
10+
11+
strategy:
12+
matrix:
13+
include:
14+
# wasm stable
15+
- name: 'stable wasm'
16+
os: 'ubuntu-latest'
17+
target: 'wasm32-unknown-unknown'
18+
rust_version: 'stable'
19+
20+
# native stable
21+
- name: 'stable linux'
22+
os: 'ubuntu-latest'
23+
target: 'x86_64-unknown-linux-gnu'
24+
rust_version: 'stable'
25+
- name: 'stable mac'
26+
os: 'macos-latest'
27+
target: 'x86_64-apple-darwin'
28+
rust_version: 'stable'
29+
- name: 'stable windows'
30+
os: 'windows-latest'
31+
target: 'x86_64-pc-windows-msvc'
32+
rust_version: 'stable'
33+
34+
fail-fast: false
35+
36+
runs-on: ${{ matrix.os }}
37+
name: ${{ matrix.name }}
38+
39+
steps:
40+
- name: checkout repo
41+
uses: actions/checkout@v2
42+
43+
- name: install rust
44+
uses: actions-rs/toolchain@v1
45+
with:
46+
toolchain: ${{ matrix.rust_version }}
47+
target: ${{ matrix.target }}
48+
profile: minimal
49+
components: clippy
50+
default: true
51+
52+
- name: caching
53+
uses: Swatinem/rust-cache@v1
54+
with:
55+
key: ${{ matrix.target }}-a # suffix for cache busting
56+
57+
- name: check
58+
uses: actions-rs/cargo@v1
59+
with:
60+
command: clippy
61+
args: --target ${{ matrix.target }} -- -D warnings
62+
63+
- name: build
64+
uses: actions-rs/cargo@v1
65+
with:
66+
command: build
67+
args: --target ${{ matrix.target }}
68+
69+
- name: test
70+
uses: actions-rs/cargo@v1
71+
with:
72+
command: test
73+
if: ${{ matrix.name != 'wasm' }}
74+
75+
- name: doc
76+
uses: actions-rs/cargo@v1
77+
env:
78+
RUSTDOCFLAGS: -D warnings
79+
with:
80+
command: doc
81+
args: --no-deps --target ${{ matrix.target }}
82+
83+
cargo-fmt:
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: checkout repo
87+
uses: actions/checkout@v2
88+
89+
- name: install rust
90+
uses: actions-rs/toolchain@v1
91+
with:
92+
toolchain: nightly
93+
profile: minimal
94+
components: rustfmt
95+
default: true
96+
97+
- name: check format
98+
uses: actions-rs/cargo@v1
99+
with:
100+
command: fmt
101+
args: -- --check
102+
103+
cargo-deny:
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: checkout repo
107+
uses: actions/checkout@v2
108+
109+
- name: check denies
110+
uses: EmbarkStudios/cargo-deny-action@v1
111+
with:
112+
log-level: warn
113+
command: check
114+
arguments: --all-features
115+
116+
publish:
117+
runs-on: ubuntu-latest
118+
119+
needs: ['build', 'cargo-fmt', 'cargo-deny']
120+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
121+
122+
steps:
123+
- name: checkout repo
124+
uses: actions/checkout@v2
125+
with:
126+
fetch-depth: 0
127+
128+
- name: install rust
129+
uses: actions-rs/toolchain@v1
130+
with:
131+
toolchain: stable
132+
profile: minimal
133+
default: true
134+
135+
- name: install cargo-readme
136+
run: |
137+
cargo install cargo-readme
138+
139+
- name: install cargo-release
140+
run: |
141+
cargo install cargo-release
142+
143+
- name: release to crates.io
144+
run: |
145+
git config user.name "releasebot"
146+
git config user.email "[email protected]"
147+
git checkout trunk
148+
149+
cargo login ${{ secrets.CRATES_TOKEN }}
150+
cargo release --skip-publish --no-confirm $( echo '${{ github.ref }}' | sed 's?refs/tags/v??' )
151+
152+
- name: generate release notes
153+
id: notes
154+
run: |
155+
NOTES=$(python -c 'import re; print(re.search("## v\\d+.\\d+.\\d+\n\nReleased \\d+-\\d+-\\d+\n\n((?:[\n]|.)*?)(?=## [vD])", open("CHANGELOG.md", "r").read()).group(1).strip().replace("%", "%25").replace("\n", "%0A"))')
156+
echo "::set-output name=notes::$NOTES"
157+
158+
- name: release to github
159+
uses: actions/create-release@v1
160+
env:
161+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
162+
with:
163+
tag_name: ${{ github.ref }}
164+
release_name: ${{ github.ref }}
165+
body: ${{ steps.notes.outputs.notes }}
166+
draft: false
167+
prerelease: false
168+
169+

.github/workflows/changelog.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Changelog
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
timeout-minutes: 1
9+
runs-on: ubuntu-latest
10+
name: Changelog Change
11+
12+
steps:
13+
- name: checkout repo
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: check changelog
19+
run: |
20+
if git diff --quiet origin/${{ github.base_ref }} HEAD CHANGELOG.md; then
21+
echo "Changelog unchanged!"
22+
exit 1
23+
fi

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.idea
2+
/.vs
13
/target
24
Cargo.lock
3-
.idea

.rustfmt.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
max_width = 120
2+
use_field_init_shorthand = true
3+
use_try_shorthand = true
4+
merge_imports = true
5+
edition = "2018"

CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to cargo's version of [Semantic Versioning](https://doc.rust-lang.org/cargo/reference/semver.html).
7+
8+
Per Keep a Changelog there are 6 main categories of changes:
9+
- Added
10+
- Changed
11+
- Deprecated
12+
- Removed
13+
- Fixed
14+
- Security
15+
16+
#### Table of Contents
17+
18+
- [Unreleased](#unreleased)
19+
- [Diffs](#diffs)
20+
21+
## Unreleased
22+
23+
## Diffs
24+
25+
<!-- Begin Diffs -->
26+

Cargo.toml

+36-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
1+
[workspace]
2+
members = [
3+
]
4+
15
[package]
2-
name = "ktx2-reader"
3-
version = "0.1.1"
4-
authors = ["f3kilo <[email protected]>"]
6+
name = "ktx2"
7+
version = "0.2.0"
8+
authors = ["Benjamin Saunders <[email protected]>", "Connor Fitzgerald <[email protected]>", "f3kilo <[email protected]>"]
59
edition = "2018"
6-
repository = "https://github.com/F3kilo/ktx2-reader"
7-
description = "Asynchronously read, validate and parse KTX v.2 texture files"
10+
description = "Parser for the ktx2 texture container format"
811
readme = "README.md"
12+
repository = "https://github.com/BVE-Reborn/ktx2"
913
license = "Apache-2.0"
14+
keywords = []
15+
categories = []
1016

1117
[features]
1218
default = ["std"]
1319
std = []
20+
21+
[package.metadata.release]
22+
pre-release-hook = ["cargo", "readme", "-o", "README.md", "-t", "README.tpl"]
23+
[[package.metadata.release.pre-release-replacements]]
24+
file = "CHANGELOG.md"
25+
search = "\\[Unreleased\\]\\(#unreleased\\)"
26+
replace = "[Unreleased](#unreleased)\n- [v{{version}}](#v{{version}})"
27+
[[package.metadata.release.pre-release-replacements]]
28+
file = "CHANGELOG.md"
29+
search = "\\[v([0-9]+)\\.([0-9]+)\\.([0-9]+)\\]\\(#v[0-9\\.]+\\)"
30+
replace = "[v$1.$2.$3](#v$1$2$3)"
31+
[[package.metadata.release.pre-release-replacements]]
32+
file = "CHANGELOG.md"
33+
search = "## Unreleased"
34+
replace = "## Unreleased\n\n## v{{version}}\n\nReleased {{date}}"
35+
[[package.metadata.release.pre-release-replacements]]
36+
file = "CHANGELOG.md"
37+
search = "\\[Unreleased\\]\\(https://github.com/BVE-Reborn/ktx2/compare/v([a-z0-9.-]+)\\.\\.\\.HEAD\\)"
38+
replace = "[Unreleased](https://github.com/BVE-Reborn/ktx2/compare/v{{version}}...HEAD)\n- [v{{version}}](https://github.com/BVE-Reborn/ktx2/compare/v$1...v{{version}})"
39+
min = 0 # allow first increment
40+
[[package.metadata.release.pre-release-replacements]]
41+
file = "CHANGELOG.md"
42+
search = "<!-- Begin Diffs -->"
43+
replace = "- [Unreleased](https://github.com/BVE-Reborn/ktx2/compare/v{{version}}...HEAD)"
44+
min = 0 # allow non-first increment

0 commit comments

Comments
 (0)