From 4decd89e443640164e61489478c92937ca11b552 Mon Sep 17 00:00:00 2001 From: Pierre Dubouilh Date: Fri, 7 Feb 2025 17:21:58 +0100 Subject: [PATCH] ci --- .github/workflows/always.yml | 36 +++++++++--------------------------- .github/workflows/deploy.yml | 31 +++++++++++++++++++++++++------ Makefile | 13 +++++++------ src/utils.rs | 1 - 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.github/workflows/always.yml b/.github/workflows/always.yml index 1b252eb..23067ba 100644 --- a/.github/workflows/always.yml +++ b/.github/workflows/always.yml @@ -1,37 +1,19 @@ -name: deploy +name: always +on: [push] -on: - push: - tags: - - '*' +env: + CARGO_TERM_COLOR: always jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run tests + - uses: actions/checkout@v2 + - name: Run CI run: make ci + - name: Install Cross + run: cargo install cross --git https://github.com/cross-rs/cross + - name: Build all artifacts run: make build-all - - - name: "Release gh release versioned" - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifacts: "builds/*" - bodyFile: "builds/buildout" - token: ${{ secrets.GITHUB_TOKEN }} - - - name: "Release gh release latest" - uses: ncipollo/release-action@v1 - with: - tag: latest - name: Latest - allowUpdates: true - artifacts: "builds/*" - bodyFile: "builds/buildout" - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6654d37..c2f5a45 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,13 +1,32 @@ -name: always -on: [push] +name: deploy -env: - CARGO_TERM_COLOR: always +on: + push: + tags: + - '*' jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Run CI + - name: Checkout + uses: actions/checkout@v4 + + - name: Run tests run: make ci + + - name: Install Cross + run: cargo install cross --git https://github.com/cross-rs/cross + + - name: Build all artifacts + run: make build-all + + - name: "Release gh release latest" + uses: ncipollo/release-action@v1 + with: + tag: latest + name: Latest + allowUpdates: true + artifacts: "builds/*" + bodyFile: "builds/buildout" + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index babad65..40320ca 100644 --- a/Makefile +++ b/Makefile @@ -16,14 +16,15 @@ ci:: test cargo clippy -- -D warnings build-all:: - cargo build --target x86_64-unknown-linux-musl --release mkdir -p builds - cp target/x86_64-unknown-linux-musl/release/blockfast builds rustc --version > builds/buildout - sha256sum builds/blockfast >> builds/buildout - -publish:: ci - cargo publish + cross build --release --target x86_64-unknown-linux-musl + cross build --release --target aarch64-unknown-linux-musl + cross build --release --target armv7-unknown-linux-musleabihf + cp target/x86_64-unknown-linux-musl/release/blockfast builds/blockfast-x86_64-linux + cp target/aarch64-unknown-linux-musl/release/blockfast builds/blockfast-aarch64-linux + cp target/armv7-unknown-linux-musleabihf/release/blockfast builds/blockfast-arm7-linux + sha256sum builds/* >> builds/buildout watch:: ls src/*.rs | entr -rc -- make run diff --git a/src/utils.rs b/src/utils.rs index 784a0e5..601f4a4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -39,7 +39,6 @@ pub fn resolve_path(a: &str) -> Result { } pub fn parse_regex(a: &str) -> Result { - println!("a {:?}", a); let r: Regex = Regex::new(a).context("invalid regexp for generic parser")?; Ok(r) }