diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..bc11730 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,17 @@ +changelog: + exclude: + authors: + - dependabot + categories: + - title: New Features + labels: + - "Type: Enhancement" + - title: Bug Fixes + labels: + - "Type: Bug" + - title: Maintenance + labels: + - "Type: Maintenance" + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml new file mode 100644 index 0000000..af31f3f --- /dev/null +++ b/.github/workflows/release-binary.yml @@ -0,0 +1,85 @@ +name: Release Binary + +on: + push: + tags: + - '*' + workflow_dispatch: + +jobs: + build: + name: Build ${{ matrix.target }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + archive: tar.gz + - target: x86_64-apple-darwin + os: macos-latest + archive: zip + - target: aarch64-apple-darwin + os: macos-latest + archive: zip + - target: x86_64-pc-windows-msvc + os: windows-latest + archive: zip + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install musl tools + if: contains(matrix.target, 'musl') + run: sudo apt-get update && sudo apt-get install -y musl-tools + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Build + run: cargo build --release --target ${{ matrix.target }} ${{ contains(matrix.target, 'musl') && '--features vendored-openssl' || '' }} + + - name: Package (Unix) + if: matrix.os != 'windows-latest' + run: | + cd target/${{ matrix.target }}/release + if [ "${{ matrix.archive }}" = "tar.gz" ]; then + tar czf ../../../x8-${{ matrix.target }}.tar.gz x8 + else + zip ../../../x8-${{ matrix.target }}.zip x8 + fi + + - name: Package (Windows) + if: matrix.os == 'windows-latest' + run: | + cd target/${{ matrix.target }}/release + 7z a ../../../x8-${{ matrix.target }}.zip x8.exe + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: x8-${{ matrix.target }} + path: x8-${{ matrix.target }}.* + + release: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: x8-* + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 0000000..8e65ae1 --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,32 @@ +name: Release Test + +on: + pull_request: + paths: + - '**.rs' + - 'Cargo.toml' + - 'Cargo.lock' + workflow_dispatch: + +jobs: + build-test: + name: Build ${{ matrix.target }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Build + run: cargo build --release --target ${{ matrix.target }} diff --git a/Cargo.toml b/Cargo.toml index 0955328..9cc1dca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,8 +30,13 @@ parking_lot = "0.11" log = "0.4.14" atty = "0.2" async-recursion = "1.0.0" -serde = "1.0" +serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" indicatif = "0.17.1" linked-hash-map = "0.5.6" strip-ansi-escapes = "0.1.1" +openssl = { version = "0.10", features = ["vendored"], optional = true } + +[features] +default = [] +vendored-openssl = ["openssl"] diff --git a/src/main.rs b/src/main.rs index cc222dc..d7293e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -298,7 +298,7 @@ async fn run( !request_defaults.parameters.contains_key(&x.name) && (x.reason_kind != ReasonKind::Code || x.status == 200) }) - .map(|x| (x.get())), + .map(|x| x.get()), )); utils::info(