diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 4bb57fc..bdf847c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,43 +8,47 @@ on: jobs: publish: - name: Publishing for ${{ matrix.os }} + name: Publishing for ${{ matrix.os }}::${{ matrix.label }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - rust: [stable] include: - os: macos-latest artifact_prefix: macOS target: x86_64-apple-darwin binary_postfix: "" + label: x86_64 - os: ubuntu-latest artifact_prefix: linux target: x86_64-unknown-linux-gnu binary_postfix: "" + label: x86_64 gnu + - os: ubuntu-latest + artifact_prefix: linux-musl + target: x86_64-unknown-linux-musl + binary_postfix: "" + label: x86_64 musl - os: windows-latest artifact_prefix: windows target: x86_64-pc-windows-msvc binary_postfix: ".exe" + label: x86_64 steps: - - name: Installing Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} - profile: minimal - override: true - name: Checkout repository - uses: actions/checkout@v2 - - name: Cargo build - uses: actions-rs/cargo@v1 + uses: actions/checkout@v4 + - name: Install Rust + run: rustup update --no-self-update + - name: Install target + run: rustup target add ${{ matrix.target }} + - name: Install musl-tools + if: ${{ runner.os == 'Linux' }} + uses: awalsh128/cache-apt-pkgs-action@v1 with: - command: build - toolchain: ${{ matrix.rust }} - args: --release --target ${{ matrix.target }} - + packages: musl-tools # provides musl-gcc + version: 1.0 + - name: Cargo build + run: cargo build --target=${{ matrix.target }} --release - name: Packaging final binary shell: bash run: | @@ -69,12 +73,6 @@ jobs: name: Publishing to Cargo runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: publish - args: --token ${{ secrets.CARGO_API_KEY }} --allow-dirty + - uses: actions/checkout@v4 + - run: rustup update --no-self-update + - run: cargo publish --token=${{ secrets.CARGO_API_KEY }} --allow-dirty diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f548cb..153a398 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,75 +1,64 @@ on: [push, pull_request] name: Continuous Integration +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: - name: Test Suite on ${{ matrix.os }} + name: Test on ${{ matrix.os }}::${{ matrix.label }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - rust: [stable] include: - os: macos-latest - artifact_prefix: macOS target: x86_64-apple-darwin - binary_postfix: "" + label: x86_64 - os: ubuntu-latest - artifact_prefix: linux target: x86_64-unknown-linux-gnu - binary_postfix: "" + label: x86_64 gnu + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + label: x86_64 musl - os: windows-latest - artifact_prefix: windows target: x86_64-pc-windows-msvc - binary_postfix: ".exe" + label: x86_64 steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + run: rustup update --no-self-update + - name: Install target + run: rustup target add ${{ matrix.target }} + - name: Install musl-tools + if: ${{ runner.os == 'Linux' }} + uses: awalsh128/cache-apt-pkgs-action@v1 with: - toolchain: stable - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - command: test + packages: musl-tools # provides musl-gcc + version: 1.0 + - name: Test + run: cargo test --target=${{ matrix.target }} rustfmt: name: Rustfmt runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - components: rustfmt + run: rustup update --no-self-update - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check clippy: name: Clippy runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - components: clippy + run: rustup update --no-self-update - name: Clippy Check - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + run: cargo clippy -- -D warnings diff --git a/README.md b/README.md index 7295f49..2235e11 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,6 @@ scoop install jwt-cli pacman -S jwt-cli ``` -## Alpine linux - -Unfortunately due to [static linking problems](https://github.com/mike-engel/jwt-cli/issues/194#issuecomment-1169211709) when compiling this project, `jwt-cli` can't run on alpine linux natively. - -A workaround is to run it inside a rust docker container rather than using `sh` within alpine. - # Usage For usage info, use the `help` command.