Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sycured committed Oct 27, 2023
1 parent fe70537 commit 18955fb
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 74 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ jobs:
if: matrix.target == 'aarch64-apple-darwin'

freebsd:
name: FreeBSD
runs-on: macos-12
name: FreeBSD ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
needs:
- check
- test
Expand All @@ -243,9 +243,11 @@ jobs:
matrix:
include:
- arch: x86-64
os: macos-12
hypervisor: xhyve
target: x86_64-unknown-freebsd
- arch: arm64
os: ubuntu-latest
hypervisor: qemu
target: aarch64-unknown-freebsd
steps:
Expand All @@ -254,7 +256,7 @@ jobs:
uses: actions/cache@v3
with:
path: target/
key: jira_cli-freebsd-${{ matrix.target }}
key: jira_cli-freebsd-${{ matrix.arch }}
- uses: cross-platform-actions/[email protected]
with:
operating_system: freebsd
Expand Down
71 changes: 40 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
artifact_name: jira_cli
asset_name: jira_cli-darwin_amd64
steps:
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: jira_cli-${{ matrix.target }}
shared-key: jira_cli-${{ matrix.target }}
cache-on-failure: true
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
name: Update Rustup and define default toolchain
- run: rustup target add ${{ matrix.target }}
Expand Down Expand Up @@ -72,11 +72,11 @@ jobs:
artifact_name: jira_cli
asset_name: jira_cli-darwin_arm
steps:
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: jira_cli-${{ matrix.target }}
shared-key: jira_cli-${{ matrix.target }}
cache-on-failure: true
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
name: Update Rustup and define default toolchain
- run: rustup target add ${{ matrix.target }}
Expand Down Expand Up @@ -107,55 +107,64 @@ jobs:
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref_name }}

freebsd-x86-64:
name: FreeBSD x86-64
freebsd:
name: FreeBSD ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: "-C target-feature=+crt-static"
runs-on: macos-12
strategy:
fail-fast: false
matrix:
include:
- arch: x86-64
os: macos-12
hypervisor: xhyve
target: x86_64-unknown-freebsd
- arch: arm64
os: ubuntu-latest
hypervisor: qemu
target: aarch64-unknown-freebsd
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache target
id: jira_cli-freebsd-x86-64
uses: actions/cache@v3
with:
path: target/
key: jira_cli-freebsd-x86-64
- uses: vmactions/freebsd-vm@v0
key: jira_cli-freebsd-${{ matrix.arch }}
- uses: cross-platform-actions/action@v0.21.0
with:
mem: 4096
usesh: true
envs: 'RUSTFLAGS'
prepare: |
mkdir -p /usr/local/etc/pkg/repos/
cp /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos/
sed -i '' -e 's/quarterly/latest/g' /usr/local/etc/pkg/repos/FreeBSD.conf
pkg upgrade -y
pkg install -y gmake rust
operating_system: freebsd
architecture: ${{ matrix.arch }}
hypervisor: ${{ matrix.hypervisor }}
version: '13.2'
shell: bash
environment_variables: RUSTFLAGS
run: |
cargo build --release --target x86_64-unknown-freebsd
sudo mkdir -p /usr/local/etc/pkg/repos/
sudo cp /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos/
sudo sed -i '' -e 's/quarterly/latest/g' /usr/local/etc/pkg/repos/FreeBSD.conf
sudo pkg upgrade -y
sudo pkg install -y gmake rust
cargo build --target ${{ matrix.target }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/x86_64-unknown-freebsd/release/jira_cli
asset_name: jira_cli-freebsd_amd64
file: target/${{ matrix.target }}/release/jira_cli
asset_name: jira_cli-freebsd_${{ matrix.arch }}
tag: ${{ github.ref_name }}


sbom:
runs-on: ubuntu-latest
name: Generate SBOM
steps:
- uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
with:
sharedKey: jira_cli-sbom
cache-on-failure: true
- name: Install cargo-cyclonedx
run: cargo install cargo-cyclonedx
Expand Down
76 changes: 46 additions & 30 deletions Cargo.lock

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

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ comfy-table = "7.1.0"
dialoguer = "0.11.0"
human-panic = "1.2.1"
itertools = "0.11.0"
tikv-jemallocator-global = "0.5.0"
lazy_static = "1.4.0"
phf = { version = "0.11.2", features = ["macros"] }
rayon = "1.8.0"
Expand All @@ -39,7 +40,4 @@ serde_json = "1.0.107"
zeroize = { version = "1.6.0", features = ["zeroize_derive"] }

[dev-dependencies]
clap = { version = "4.4.7", features = ["cargo", "deprecated", "env", "wrap_help"] }

[target.'cfg(not(target_os = "windows"))'.dependencies]
jemallocator = "0.5.4"
clap = { version = "4.4.7", features = ["cargo", "deprecated", "env", "wrap_help"] }
6 changes: 0 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ use std::io::stdout;
use clap::{ArgMatches, Command};
use clap_complete::{generate, Generator, Shell};
use human_panic::setup_panic;
#[cfg(not(target_os = "windows"))]
use jemallocator::Jemalloc;

use jira_cli::Global;

use crate::cli::{check_version, group, issue, labels, license, project, user};

#[cfg(not(target_os = "windows"))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

fn print_completions<G: Generator>(gen: G, cmd: &mut Command) {
generate(gen, cmd, cmd.get_name().to_owned(), &mut stdout());
}
Expand Down

0 comments on commit 18955fb

Please sign in to comment.