diff --git a/.github/workflows/rust-build-release.yml b/.github/workflows/rust-build-release.yml index 92c54c5..db245aa 100644 --- a/.github/workflows/rust-build-release.yml +++ b/.github/workflows/rust-build-release.yml @@ -5,7 +5,7 @@ on: branches: - master tags: - - '*' + - "*" jobs: build: @@ -22,55 +22,60 @@ 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] @@ -78,35 +83,35 @@ jobs: 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] @@ -114,24 +119,24 @@ jobs: 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 "runner@github.com" - 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 "runner@github.com" + 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}" diff --git a/Cargo.lock b/Cargo.lock index 930eb9d..b67a72b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2692,9 +2692,9 @@ dependencies = [ [[package]] name = "shadow-rs" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c282402d25101f9c893e9cd7e4cae535fe7db18b81291de973026c219ddf1e" +checksum = "25d4535372eab969a98536e39dd272bca49fc338b09b25babea715968d15eeae" dependencies = [ "const_format", "git2", diff --git a/Cargo.toml b/Cargo.toml index 21b536a..69d4d4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] }