Skip to content

Commit

Permalink
chore: setup CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bestmike007 committed Dec 27, 2024
1 parent 7d589ad commit d0353eb
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Continuous Integration (CI)
on: [push]

concurrency:
group: "ci-${{ github.ref_name }}"
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: cargo test
run: |
cargo fmt --check
cargo test
release:
needs: [test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- target: x86_64-unknown-linux-gnu
name: amd64
- target: aarch64-unknown-linux-gnu
name: aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust with Cross
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
rustup toolchain install stable --profile minimal
rustup target add ${{ matrix.arch.target }}
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cross
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.arch.target }}
cache-on-failure: true
- name: Build Binary
run: |
cross build --verbose --locked --release --target ${{ matrix.arch.target }}
mv target/${{ matrix.arch.target }}/release/wg-multizone target/${{ matrix.arch.target }}/release/wg-multizone-${{ matrix.arch.name }}
- name: publish artifacts
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
target/${{ matrix.arch.target }}/release/wg-multizone-${{ matrix.arch.name }}

0 comments on commit d0353eb

Please sign in to comment.