Skip to content

Commit

Permalink
ci(fix): add protobuf dependencies (#15)
Browse files Browse the repository at this point in the history
Description
Add protobuf dependencies for ci and release
Add push to release for releases

Motivation and Context
Fix CI and releases better by removing double CI builds

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
leet4tari authored Aug 3, 2024
1 parent f3b93e1 commit b418c45
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 27 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }}

permissions: {}

jobs:
clippy:
name: clippy
runs-on: [ ubuntu-latest ]
steps:
- name: checkout
uses: actions/checkout@v4

- name: created empty dist dir
run: "mkdir dist"
run: |
mkdir dist
- name: install dependencies (linux)
if: startsWith(runner.os,'Linux')
run: |
Expand All @@ -35,19 +40,26 @@ jobs:
libwebkit2gtk-4.0-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf
patchelf \
libprotobuf-dev \
protobuf-compiler
- name: toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: cache cargo files and outputs
if: ${{ ( startsWith(runner.environment,'github-hosted') ) && ( ! startsWith(github.ref, 'refs/tags/v') ) }}
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: cargo format
working-directory: ./src-tauri
run: cargo fmt --all -- --check
run: |
cargo fmt --all -- --check
- name: clippy check (with lints)
working-directory: ./src-tauri
run: |
Expand All @@ -60,15 +72,18 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4

- name: toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: cache cargo files and outputs
if: ${{ ( startsWith(runner.environment,'github-hosted') ) && ( ! startsWith(github.ref, 'refs/tags/v') ) }}
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: cargo machete
working-directory: ./src-tauri
run: |
Expand All @@ -81,6 +96,7 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4

- name: install dependencies (linux)
if: startsWith(runner.os,'Linux')
run: |
Expand All @@ -89,16 +105,22 @@ jobs:
libwebkit2gtk-4.0-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf
patchelf \
libprotobuf-dev \
protobuf-compiler
- name: toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: cache cargo files and outputs
if: ${{ ( startsWith(runner.environment,'github-hosted') ) && ( ! startsWith(github.ref, 'refs/tags/v') ) }}
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: cargo check
working-directory: ./src-tauri
run: cargo check --release --all-targets --workspace --locked
run: |
cargo check --release --all-targets --workspace --locked
52 changes: 30 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: Release
push:
paths-ignore:
- '**/*.md'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- 'main'
- 'release'
- 'build-*'
workflow_dispatch:

Expand All @@ -29,7 +29,7 @@ jobs:
matrix:
include:
# - platform: 'ubuntu-20.04'
# args: ''
# args: ''
- platform: 'windows-2019'
args: ''
- platform: 'macos-latest'
Expand All @@ -46,36 +46,25 @@ jobs:
node-version: lts/*
cache: 'npm'

- name: Rust setup (macOS)
if: startsWith(runner.os,'macOS')
uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-apple-darwin,x86_64-apple-darwin

- name: Rust setup (linux)
if: startsWith(runner.os,'Linux')
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-unknown-linux-gnu

- name: Rust setup (macOS)
if: startsWith(runner.os,'macOS')
uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-apple-darwin,x86_64-apple-darwin

- name: Cache cargo files and outputs
if: ${{ ( ! startsWith(github.ref, 'refs/tags/v') ) }}
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'


- name: Install Windows dependencies
if: startsWith(runner.os,'Windows')
run: |
choco upgrade protoc -y
- name: Install dependencies (Macos)
if: startsWith(runner.os,'macOS')
run: |
brew install protobuf
- name: Install dependencies (linux)
if: startsWith(runner.os,'Linux')
run: |
Expand All @@ -85,7 +74,26 @@ jobs:
libappindicator3-dev \
librsvg2-dev \
patchelf \
protobuf-compiler
libprotobuf-dev \
protobuf-compiler
- name: Install dependencies (macOS)
if: startsWith(runner.os,'macOS')
run: |
# openssl, cmake and autoconf already installed
brew install zip coreutils automake protobuf libtool
- name: Install dependencies (Windows)
if: startsWith(runner.os,'Windows')
run: |
vcpkg.exe install sqlite3:x64-windows zlib:x64-windows
choco upgrade protoc -y
- name: Set environment variables (Windows)
if: startsWith(runner.os,'Windows')
shell: bash
run: |
echo "SQLITE3_LIB_DIR=C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV
- name: Install dependencies (node)
run: |
Expand Down

0 comments on commit b418c45

Please sign in to comment.