Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
Improve release pipeline & cargo fmt code
Browse files Browse the repository at this point in the history
  • Loading branch information
containerscrew committed Nov 17, 2023
1 parent a7a8099 commit df8f01d
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Rust Code Coverage
name: Rust Code Coverage 🚦

on:
push:
branches:
- '**'
- 'main'
tags:
- '*'
- '**'

jobs:
coverage:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Gitleaks
name: Gitleaks 🕷️
on:
pull_request:
push:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # run once a day at 4 AM
- cron: "0 0 1 * *" # run once a month
jobs:
scan:
name: gitleaks
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Release 📦

on:
push:
branches:
- "**"
tags:
- 'v*.*.*'

Expand All @@ -30,11 +28,15 @@ jobs:
rustup target add x86_64-unknown-linux-musl
sudo apt-get -qq install musl-tools
- name: Build for ${{ matrix.os }} (arm64/amd64)
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
run: |
make release-linux
- name: Build for macOS
if: matrix.os == 'macOS-latest'
run: make release_mac

- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Test 🛠️
on:
push:
branches:
- "main"
- '**'
tags:
- '*'
- '**'

env:
CARGO_TERM_COLOR: always
Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ doctoc: ## Create table of contents with doctoc
pre-commit: ## Run pre-commit
pre-commit run -a

release-linux: ## Create release
release-linux: ## Create release for linux arm and amd64
# First make release for amd64
cargo build --release --target=x86_64-unknown-linux-musl
zip -j ${BIN_NAME}-v${VERSION}-x86_64-linux.zip target/x86_64-unknown-linux-musl/release/${BIN_NAME}
# Then, release for arm64
zip -j ${BINARY_NAME}-v${VERSION}-x86_64-linux.zip target/x86_64-unknown-linux-musl/release/${BINARY_NAME}
# Release for arm64
cargo build --release --target=aarch64-unknown-linux-gnu
zip -j ${BIN_NAME}-v${VERSION}-arm64-linux.zip target/aarch64-unknown-linux-gnu/release/${BIN_NAME}
zip -j ${BINARY_NAME}-v${VERSION}-arm64-linux.zip target/aarch64-unknown-linux-gnu/release/${BINARY_NAME}


release-mac: ## Create release for mac arm and amd64
cargo build --release --target=x86_64-apple-darwin
zip -j ${BINARY_NAME}-v${VERSION}-x86_64-mac.zip target/x86_64-apple-darwin/release/${BINARY_NAME}
# Release for arm64
cargo build --release --target=aarch64-apple-darwin
zip -j ${BINARY_NAME}-v${VERSION}-arm64-mac.zip target/aarch64-apple-darwin/release/${BINARY_NAME}
5 changes: 4 additions & 1 deletion src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ pub async fn async_start(
let account_list = get_account_list(&sso_client, &token).await?;

// Provide info about all account that should be downloaded
info!("{} accounts to fetch. Each account can have multiple roles", account_list.len());
info!(
"{} accounts to fetch. Each account can have multiple roles",
account_list.len()
);

let mut all_credentials: Vec<AccountCredentials> = vec![];

Expand Down
3 changes: 1 addition & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::fs::{File, OpenOptions};
use crate::commands::config::{CONFIG_FILE_PATH, CREDENTIALS_FILE_PATH};
use aws_sso_auth::AccountCredentials;
use colored::Colorize;
use configparser::ini::Ini;
use log::{error, info};
use std::fs::{File, OpenOptions};
use std::io;
use std::io::{Read, Write};
use std::process::exit;
Expand Down Expand Up @@ -80,7 +80,6 @@ pub fn write_configuration(all_credentials: Vec<AccountCredentials>, region_name
info!("Configuration file saved!")
}


// pub fn config_file_exists(path: &str) {
// // This function checks if config file ~/.aws/aws-sso-auth.json exists
// // If not, will try to create a new one
Expand Down

0 comments on commit df8f01d

Please sign in to comment.