Skip to content

Commit

Permalink
Add NASM to windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBoot committed Aug 14, 2024
1 parent ad3f60d commit dd86193
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 123 deletions.
205 changes: 105 additions & 100 deletions .github/workflows/rust-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
tags:
- '*'
- "*"

jobs:
build:
Expand All @@ -22,116 +22,121 @@ jobs:
os: mac

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.runs-on }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Build
run: cargo build --release

- name: Prepare artifacts
shell: bash
run: |-
mkdir dist
for file in autokuma autokuma.exe kuma kuma.exe; do
if [[ ! -e "target/release/$file" ]]; then
continue
fi
filename=$(basename "$file")
if [[ "$filename" == *.* ]]; then
extension=".${filename##*.}"
filename="${filename%.*}"
else
extension=""
fi
mv "target/release/${filename}${extension}" "dist/${filename}-${{ matrix.os }}${extension}"
done
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: autokuma-${{ matrix.os }}
path: dist/*
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.runs-on }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup NASM
if: matrix.os == 'windows'
run: |
choco install nasm -y
refreshenv
- name: Build
run: cargo build --release

- name: Prepare artifacts
shell: bash
run: |-
mkdir dist
for file in autokuma autokuma.exe kuma kuma.exe; do
if [[ ! -e "target/release/$file" ]]; then
continue
fi
filename=$(basename "$file")
if [[ "$filename" == *.* ]]; then
extension=".${filename##*.}"
filename="${filename%.*}"
else
extension=""
fi
mv "target/release/${filename}${extension}" "dist/${filename}-${{ matrix.os }}${extension}"
done
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: autokuma-${{ matrix.os }}
path: dist/*

github-release:
needs: [build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release

- name: Parse Changelog
id: changelog
uses: coditory/changelog-parser@v1

- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: autokuma-*
merge-multiple: true

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Release ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.description }}
files: dist/*
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release

- name: Parse Changelog
id: changelog
uses: coditory/changelog-parser@v1

- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: autokuma-*
merge-multiple: true

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Release ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.description }}
files: dist/*

crates-io:
needs: [build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-release,markdown-extract

- name: setup git
shell: bash
run: |-
git config user.email "[email protected]"
git config user.name "Github Runner"
- name: Publish to crates.io
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo release --workspace --execute --no-confirm "${GITHUB_REF_NAME#v}"
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-release,markdown-extract

- name: setup git
shell: bash
run: |-
git config user.email "[email protected]"
git config user.name "Github Runner"
- name: Publish to crates.io
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo release --workspace --execute --no-confirm "${GITHUB_REF_NAME#v}"
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,42 @@ repository = "https://github.com/BigBoot/AutoKuma"

[workspace.dependencies]
bollard = { version = "0.17.0", features = ["ssl"] }
clap = { version = "4.4.14", features = ["derive"] }
clap = { version = "4.5.15", features = ["derive"] }
config = { version = "0.14.0" }
const-str = { version = "0.5.6", features = ["proc"] }
const-str = { version = "0.5.7", features = ["proc"] }
console-subscriber = { version = "0.4.0" }
cute_custom_default = { version = "2.1.0" }
cute_custom_default = { version = "2.2.0" }
derivative = { version = "2.2.0" }
dirs = { version = "5.0.1" }
flexi_logger = { version = "0.28.0", features = ["compress"] }
flexi_logger = { version = "0.28.5", features = ["compress"] }
futures-util = { version = "0.3.30" }
humantime-serde = { version = "1.1.1" }
inkjet = { version = "0.10.4", default-features = false, features = [
inkjet = { version = "0.10.5", default-features = false, features = [
"language-yaml",
"language-json",
] }
itertools = { version = "0.13.0" }
log = { version = "0.4.20" }
log = { version = "0.4.22" }
native-tls = { version = "0.2.12" }
owo-colors = { version = "4.0.0" }
regex = { version = "1.5.4" }
reqwest = { version = "0.12.2", features = ["json"] }
regex = { version = "1.10.6" }
reqwest = { version = "0.12.5", features = ["json"] }
rust_socketio = { version = "0.6.0", features = ["async"] }
serde = { version = "1.0.194", features = ["derive"] }
serde = { version = "1.0.207", features = ["derive"] }
serde_alias = { version = "0.0.2" }
serde_json = { version = "1.0.111" }
serde_json = { version = "1.0.124" }
serde_merge = { version = "0.1.3" }
serde_repr = { version = "0.1.18" }
serde_with = { version = "3.4.0", features = ["time_0_3"] }
serde_repr = { version = "0.1.19" }
serde_with = { version = "3.9.0", features = ["time_0_3"] }
serde-inline-default = { version = "0.2.0" }
serde_yaml = { version = "0.9.30" }
serde_yaml = { version = "0.9.34" }
unescaper = { version = "0.1.5" }
shadow-rs = { version = "0.31.1" }
strum = { version = "0.26.1", features = ["derive"] }
shadow-rs = { version = "0.32.0" }
strum = { version = "0.26.3", features = ["derive"] }
supports-color = { version = "3.0.0" }
tera = { version = "1.19.1" }
thiserror = { version = "1.0.56" }
time = { version = "0.3.31", features = ["serde"] }
tokio = { version = "1.35.1", features = ["full"] }
toml = { version = "0.8.8" }
url = { version = "2.5.0", features = ["serde"] }
tera = { version = "1.20.0" }
thiserror = { version = "1.0.63" }
time = { version = "0.3.36", features = ["serde"] }
tokio = { version = "1.39.2", features = ["full"] }
toml = { version = "0.8.19" }
url = { version = "2.5.2", features = ["serde"] }

0 comments on commit dd86193

Please sign in to comment.