Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
hitchhooker committed Dec 15, 2024
0 parents commit eca199e
Show file tree
Hide file tree
Showing 7 changed files with 1,029 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
name: Release - ${{ matrix.platform.release_for }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- release_for: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin: sshproxygen
name: sshproxygen-linux-amd64

- release_for: Linux-aarch64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
bin: sshproxygen
name: sshproxygen-linux-arm64
use_cross: true

- release_for: macOS-x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: sshproxygen
name: sshproxygen-macos-amd64

- release_for: macOS-aarch64
os: macos-latest
target: aarch64-apple-darwin
bin: sshproxygen
name: sshproxygen-macos-arm64

steps:
- uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.target }}

- name: Install cross
if: ${{ matrix.platform.use_cross }}
run: cargo install cross

- name: Build binary
if: ${{ !matrix.platform.use_cross }}
run: cargo build --verbose --release --target ${{ matrix.platform.target }}

- name: Build binary using cross
if: ${{ matrix.platform.use_cross }}
run: cross build --verbose --release --target ${{ matrix.platform.target }}

- name: Prepare binary
run: |
cd target/${{ matrix.platform.target }}/release
cp ${{ matrix.platform.bin }} ${{ matrix.platform.name }}
- name: Upload binaries to release
uses: softprops/action-gh-release@v1
with:
files: target/${{ matrix.platform.target }}/release/${{ matrix.platform.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit eca199e

Please sign in to comment.