Skip to content

linux support

linux support #90

Workflow file for this run

name: Release
on:
# Triggers the workflow on push events but only for the master branch
push:
tags:
- "v*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up GPG
run: |
echo "$GPG_PRIVATE_KEY" | base64 -d --ignore-garbage | gpg --import --batch
gpg --list-secret-keys --keyid-format LONG
gpg --list-keys
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Build
run: cargo build --release --bin satori
env:
CARGO_TERM_COLOR: always
# - name: Sign Binary
# run: |
# echo "$GPG_PRIVATE_KEY" | gpg --batch --pinentry-mode loopback --passphrase-fd 0 --detach-sign --armor -u devops@satoricyber.com --output gpg.sig target/release/satori
# env:
# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Move binary
run: |
mv target/release/satori satori
- name: Generate auto complete
run: ./satori auto_complete --generate bash --out satori_auto_complete.sh
- id: get_version
uses: battila7/get-version-action@v2
- name: Create release
run: |
zip -jr satori-${{ steps.get_version.outputs.version-without-v }}-linux.zip satori satori_auto_complete.sh
tar czf satori-${{ steps.get_version.outputs.version-without-v }}-linux.tar.gz satori satori_auto_complete.sh
- name: Upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
files: |
./**/*.tar.gz
./**/*.zip
gpg.sig
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: rustup
run: |
rustup target add x86_64-apple-darwin
- name: Build
run: cargo build --release --bin satori
env:
CARGO_TERM_COLOR: always
- name: move binary
run: |
mv target/release/satori.exe satori.exe
- name: Generate auto complete
run: |
./satori.exe auto_complete --generate powershell --out satori_auto_complete.ps1
- id: get_version
uses: battila7/get-version-action@v2
- name: Create release
run: |
Compress-Archive -Path "satori.exe", "satori_auto_complete.ps1" -DestinationPath "satori-${{ steps.get_version.outputs.version-without-v }}-windows.zip"
- name: Upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
files: |
./**/*.zip
build-macOS-ARM:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- id: get_version
uses: battila7/get-version-action@v2
- name: add arm64 target
run: |
rustup target add aarch64-apple-darwin
- name: Install Dependencies
run: |
brew install qemu
brew install FiloSottile/musl-cross/musl-cross
- name: Build
run: cargo build --target=aarch64-apple-darwin --release --bin satori
env:
CARGO_TERM_COLOR: always
- name: rename binary
run: |
mv target/aarch64-apple-darwin/release/satori satori_arm64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: satori_arm64
path: satori_arm64
build-macOS-intel:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: rustup
run: |
rustup target add x86_64-apple-darwin
- name: Build
run: cargo build --release --bin satori
env:
CARGO_TERM_COLOR: always
- name: rename binary
run: |
mv target/release/satori satori_x86_64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: satori_x86_64
path: satori_x86_64
publish-mac:
needs: [build-macOS-intel, build-macOS-ARM]
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: satori_*
- name: Display artifacts
run: |
ls -R
- name: universal binary
run: |
lipo -create -output satori satori_x86_64 satori_arm64
- id: get_version
uses: battila7/get-version-action@v2
- name: generate autocomlete for zsh
run: |
chmod a+x satori
./satori auto_complete --generate zsh --out satori_auto_complete.zsh
- name: Create release
run: |
zip -jr satori-${{ steps.get_version.outputs.version-without-v }}-macOS.zip satori satori_auto_complete.zsh
tar czf satori-${{ steps.get_version.outputs.version-without-v }}-macOS.tar.gz satori satori_auto_complete.zsh
- name: Upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
files: |
./**/*.tar.gz
./**/*.zip
- name: Homebew
uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: satori_cli
formula-path: Formula/satori_cli.rb
download-url: https://github.com/SatoriCyber/satori-cli/releases/download/v${{ steps.get_version.outputs.version-without-v }}/satori-${{ steps.get_version.outputs.version-without-v }}-macOS.tar.gz
homebrew-tap: SatoriCyber/homebrew-satori
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}