Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
namachan10777 committed Oct 6, 2024
1 parent cb79108 commit 13c82c5
Show file tree
Hide file tree
Showing 8 changed files with 1,756 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ["--cfg", "tracing_unstable"]
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- { name: "x86_64", target: "x86_64-unknown-linux-musl" }
- { name: "aarch64", target: "aarch64-unknown-linux-musl" }
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.arch.target }}
- uses: Swatinem/rust-cache@v2
with:
prefix: ${{ matrix.arch.name }}
- run: cargo clippy --target ${{ matrix.arch.target }} --all-targets -- -D warnings
- run: cargo fmt -- --check
- run: cargo test --target ${{ matrix.arch.target }} --all-features
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release binary

on:
push:
tags:
- "*"

jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- { name: "x86_64", target: "x86_64-unknown-linux-musl" }
- { name: "aarch64", target: "aarch64-unknown-linux-musl" }
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.arch.target }}
- uses: Swatinem/rust-cache@v2
with:
prefix: ${{ matrix.arch.name }}
- run: cargo build --release
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ""
draft: true
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/release/ssh-key-sync
asset_name: ssh-key-sync_${{ matrix.arch.name }}
asset_content_type: application/octet-stream
- name: Publish release
uses: StuYarrow/publish-release@v1.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.create_release.outputs.id }}
23 changes: 2 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
target
authorized_keys
Loading

0 comments on commit 13c82c5

Please sign in to comment.