Cleanup template

This commit is contained in:
Jake Shadle
2021-08-11 08:46:54 +02:00
parent 462d8c346b
commit a7ba72a00a
9 changed files with 44 additions and 227 deletions
+1 -5
View File
@@ -1,5 +1 @@
# Documentation for this file can be found on the GitHub website here:
# https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners
#
# TODO: uncomment this line and set the maintainers' GitHub usernames
# * @first_maintainer_username @second_maintainer_username
* @Jake-Shadle
-32
View File
@@ -1,32 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Device:**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
-20
View File
@@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
-13
View File
@@ -1,13 +0,0 @@
### Checklist
* [ ] I have read the [Contributor Guide](../../CONTRIBUTING.md)
* [ ] I have read and agree to the [Code of Conduct](../../CODE_OF_CONDUCT.md)
* [ ] I have added a description of my changes and why I'd like them included in the section below
### Description of Changes
Describe your changes here
### Related Issues
List related issues here
+23 -123
View File
@@ -1,18 +1,16 @@
# TODO: Replace this line with the commented ones to actually run the action in your repo(s)
on: public
# on:
# push:
# branches:
# - main
# tags:
# - "*"
# pull_request:
on:
push:
branches:
- main
tags:
- "*"
pull_request:
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
@@ -35,10 +33,7 @@ jobs:
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
@@ -54,18 +49,16 @@ jobs:
- name: cargo test
run: cargo test --release
# TODO: Remove this check if you don't use cargo-deny in the repo
deny-check:
name: cargo-deny
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
# TODO: Remove this check if you don't publish the crate(s) from this repo
publish-check:
name: Publish Check
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
@@ -76,142 +69,49 @@ jobs:
- name: cargo publish check
run: cargo publish --dry-run
# TODO: Remove this job if you don't publish the crate(s) from this repo
# You must add a crates.io API token to your GH secrets and name it CRATES_IO_TOKEN
publish:
name: Publish
needs: [test, deny-check, publish-check]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo fetch
- name: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
run: cargo publish
# TODO: Remove this job if you don't release binaries
# Replace occurances of $BIN_NAME with the name of your binary
release:
name: Release
needs: [test, deny-check]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
bin: $BIN_NAME
# We don't enable the progress feature when targeting
# musl since there are some dependencies on shared libs
features: ""
- os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
bin: $BIN_NAME.exe
features: progress
- os: macOS-latest
rust: stable
target: x86_64-apple-darwin
bin: $BIN_NAME
features: progress
runs-on: ${{ matrix.os }}
runs-on: ubuntu-20.04
steps:
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
toolchain: stable
override: true
target: ${{ matrix.target }}
target: x86_64-unknown-linux-musl
- name: Install musl tools
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y musl-tools
- name: Checkout
uses: actions/checkout@v2
- run: cargo fetch --target ${{ matrix.target }}
- run: cargo fetch --target x86_64-unknown-linux-musl
- name: Release build
shell: bash
run: |
if [ "${{ matrix.features }}" != "" ]; then
cargo build --release --target ${{ matrix.target }} --features ${{ matrix.features }}
else
cargo build --release --target ${{ matrix.target }}
fi
cargo build --release --target x86_64-unknown-linux-musl
- name: Package
shell: bash
run: |
name=$BIN_NAME
name=xwin
tag=$(git describe --tags --abbrev=0)
release_name="$name-$tag-${{ matrix.target }}"
target="x86_64-unknown-linux-musl"
release_name="$name-$tag-$target"
release_tar="${release_name}.tar.gz"
mkdir "$release_name"
if [ "${{ matrix.target }}" != "x86_64-pc-windows-msvc" ]; then
strip "target/${{ matrix.target }}/release/${{ matrix.bin }}"
fi
strip "target/$target/release/$name"
cp "target/${{ matrix.target }}/release/${{ matrix.bin }}" "$release_name/"
cp "target/$target/release/$name" "$release_name/"
cp README.md LICENSE-APACHE LICENSE-MIT "$release_name/"
tar czvf "$release_tar" "$release_name"
rm -r "$release_name"
# Windows environments in github actions don't have the gnu coreutils installed,
# which includes the shasum exe, so we just use powershell instead
if [ "${{ matrix.os }}" == "windows-latest" ]; then
echo "(Get-FileHash \"${release_tar}\" -Algorithm SHA256).Hash | Out-File -Encoding ASCII -NoNewline \"${release_tar}.sha256\"" | pwsh -c -
else
echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256"
fi
echo -n "$(shasum -ba 256 "${release_tar}" | cut -d " " -f 1)" > "${release_tar}.sha256"
- name: Publish
uses: softprops/action-gh-release@v1
with:
draft: true
files: "$BIN_NAME*"
files: "xwin*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TODO: Remove this job if you don't publish container images on each release
# TODO: Create a repository on DockerHub with the same name as the GitHub repo
# TODO: Add the new repo to the buildbot group with read & write permissions
# TODO: Add the embarkbot dockerhub password to the repo secrets as DOCKERHUB_PASSWORD
publish-container-images:
name: Publish container images
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [test, deny-check]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: embarkbot
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: embarkstudios/${{ github.event.repository.name }}
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
Generated
+1
View File
@@ -114,6 +114,7 @@ checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd"
[[package]]
name = "cfb"
version = "0.4.0"
source = "git+https://github.com/Jake-Shadle/rust-cfb?rev=3dcfcf6#3dcfcf6b91b63b69780d21323a05b27ec95cffea"
dependencies = [
"byteorder",
"uuid",
+5 -1
View File
@@ -1,8 +1,12 @@
[package]
name = "xwin"
version = "0.1.0"
description = "Allows downloading and repacking the MSVC and Windows SDK for cross compilation"
authors = ["Jake Shadle <jake.shadle@embark-studios.com>"]
edition = "2018"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/Jake-Shadle/xwin"
homepage = "https://github.com/Jake-Shadle/xwin"
[dependencies]
ansi_term = "0.12"
@@ -55,4 +59,4 @@ name = "xwin"
path = "src/bin.rs"
[patch.crates-io]
cfb = { path = "../rust-cfb" }
cfb = { git = "https://github.com/Jake-Shadle/rust-cfb", rev = "3dcfcf6" }
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2019 Embark Studios
Copyright (c) 2021 Jake Shadle
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
+13 -32
View File
@@ -1,44 +1,25 @@
<!--- FIXME: Pick an emoji! --->
# 🌻 opensource-template
# xwin
<!--- FIXME: Update crate, repo and CI workflow names here! Remove any that are not relevant --->
[![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)
[![Crates.io](https://img.shields.io/crates/v/rust-gpu.svg)](https://crates.io/crates/rust-gpu)
[![Docs](https://docs.rs/rust-gpu/badge.svg)](https://docs.rs/rust-gpu)
[![dependency status](https://deps.rs/repo/github/EmbarkStudios/rust-gpu/status.svg)](https://deps.rs/repo/github/EmbarkStudios/rust-gpu)
[![Build status](https://github.com/EmbarkStudios/physx-rs/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/physx-rs/actions)
[![Crates.io](https://img.shields.io/crates/v/xwin.svg)](https://crates.io/crates/xwin)
[![Docs](https://docs.rs/xwin/badge.svg)](https://docs.rs/xwin)
[![dependency status](https://deps.rs/repo/github/Jake-Shadle/xwin/status.svg)](https://deps.rs/repo/github/Jake-Shadle/xwin)
[![Build status](https://github.com/Jake-Shadle/xwin/workflows/CI/badge.svg)](https://github.com/Jake-Shadle/xwin/actions)
Template for creating new open source repositories that follow the Embark open source guidelines.
A utility for downloading and packaging the [Microsoft CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?redirectedfrom=MSDN&view=msvc-160) headers and libraries, and [Windows SDK](https://en.wikipedia.org/wiki/Microsoft_Windows_SDK) headers and libraries needed for compiling and linking programs targetting Windows.
## TEMPLATE INSTRUCTIONS
## Introduction
Based off of https://github.com/mstorsjo/msvc-wine.
The goal of this project is to create a root directory for both the CRT and Windows SDK that each contain all of the necessary includes and libraries needed for an application to compile and link from a non-Windows platform, using a native cross compiling toolchain like clang/LLVM.
1. Create a new repository under EmbarkStudios using this template.
1. __Title:__ Change the first line of this README to the name of your project, and replace the sunflower with an emoji that represents your project. 🚨 Your emoji selection is critical.
1. __Badges:__ In the badges section above, change the repo name in each URL. If you are creating something other than a Rust crate, remove the crates.io and docs badges (and feel free to add more appropriate ones for your language).
1. __CI:__ In `./github/workflows/` rename `rust-ci.yml` (or the appropriate config for your language) to `ci.yml`. And go over it and adapt it to work for your project
1. __Cleanup:__ Remove this section of the README and any unused files (such as configs for other languages) from the repo.
### Thanks
## Contribution
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](../main/CODE_OF_CONDUCT.md)
We welcome community contributions to this project.
Please read our [Contributor Guide](CONTRIBUTING.md) for more information on how to get started.
Please also read our [Contributor Terms](CONTRIBUTING.md/#Contributor-Terms) before you make any contributions.
Any contribution intentionally submitted for inclusion in an Embark Studios project, shall comply with the Rust standard licensing model (MIT + Apache 2.0) and therefore be dual licensed as described below, without any additional terms or conditions:
Special thanks to <https://github.com/mstorsjo/msvc-wine> for the inspiration.
### License
This [contribution] is dual licensed under EITHER OF
This contribution is dual 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.
For clarity, "your" refers to Embark or any other licensee/user of the contribution.