Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a release workflow #7

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: 🔨 Build
on:
pull_request:
push:
branches: ["main", "master", "develop", "release"]
# name: 🔨 Build
# on:
# pull_request:
# push:
# branches: ["main", "master", "develop", "release"]

env:
CARGO_TERM_COLOR: always
# env:
# CARGO_TERM_COLOR: always

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain: [stable, beta, nightly]
name: 🔨 Build release
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install latest ${{ matrix.toolchain }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libudev-dev
- name: Build release
run: cd src-tauri/ ; cargo build --release
# jobs:
# build:
# strategy:
# matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
# toolchain: [stable, beta, nightly]
# name: 🔨 Build release
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v2
# - name: Install latest ${{ matrix.toolchain }}
# uses: actions-rs/toolchain@v1
# with:
# toolchain: ${{ matrix.toolchain }}
# - uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# - name: install dependencies (ubuntu only)
# if: matrix.os == 'ubuntu-latest'
# run: |
# sudo apt-get update
# sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libudev-dev
# - name: Build release
# run: cd src-tauri/ ; cargo build --release
48 changes: 24 additions & 24 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@

name: 👔 Check formatting
# name: 👔 Check formatting

on:
pull_request:
push:
branches: ["main", "master", "develop", "release"]
# on:
# pull_request:
# push:
# branches: ["main", "master", "develop", "release"]

env:
CARGO_TERM_COLOR: always
# env:
# CARGO_TERM_COLOR: always

jobs:
check_format:
name: 👔 Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v2
- name: Check Formatting
run: cd src-tauri/ ; cargo fmt -- --verbose --check --color auto
# jobs:
# check_format:
# name: 👔 Check formatting
# runs-on: ubuntu-latest
# steps:
# - uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# - uses: actions/checkout@v2
# - name: Check Formatting
# run: cd src-tauri/ ; cargo fmt -- --verbose --check --color auto
62 changes: 31 additions & 31 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@

name: 🖋 Check linting
# name: 🖋 Check linting

on:
pull_request:
push:
branches: ["main", "master", "develop", "release"]
# on:
# pull_request:
# push:
# branches: ["main", "master", "develop", "release"]

env:
CARGO_TERM_COLOR: always
# env:
# CARGO_TERM_COLOR: always

jobs:
check_lint_rust:
name: 🖋 Check linting
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v2
- name: install dependencies (ubuntu only)
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libudev-dev
- name: Check linting
run: |
rustup component add clippy
set env RUSTFLAGS="-Dwarnings"
cd src-tauri/ ; cargo clippy --workspace -- -D warnings
# jobs:
# check_lint_rust:
# name: 🖋 Check linting
# runs-on: ubuntu-latest
# steps:
# - uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# - uses: actions/checkout@v2
# - name: install dependencies (ubuntu only)
# run: |
# sudo apt-get update
# sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libudev-dev
# - name: Check linting
# run: |
# rustup component add clippy
# set env RUSTFLAGS="-Dwarnings"
# cd src-tauri/ ; cargo clippy --workspace -- -D warnings
86 changes: 43 additions & 43 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
name: 📦 Package
# name: 📦 Package

on:
pull_request:
push:
branches: ["main", "master", "develop", "release"]
# on:
# pull_request:
# push:
# branches: ["main", "master", "develop", "release"]

env:
CARGO_TERM_COLOR: always
# env:
# CARGO_TERM_COLOR: always

jobs:
audit:
name: 🐞 Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
- name: Dependency audit
run: cd src-tauri/ ; cargo make audit
cargo_check:
name: 📦 Check package integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install dependencies (ubuntu only)
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libudev-dev
- name: Check package integrity
run: cd src-tauri/ ; cargo package --verbose
check_unused_deps:
name: 📦 Check for unused dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
- name: Check deps with machete
run: cd src-tauri/ ; cargo make deps
# jobs:
# audit:
# name: 🐞 Dependency audit
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - uses: davidB/rust-cargo-make@v1
# - name: Dependency audit
# run: cd src-tauri/ ; cargo make audit
# cargo_check:
# name: 📦 Check package integrity
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: install dependencies (ubuntu only)
# run: |
# sudo apt-get update
# sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libudev-dev
# - name: Check package integrity
# run: cd src-tauri/ ; cargo package --verbose
# check_unused_deps:
# name: 📦 Check for unused dependencies
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# override: true
# - uses: davidB/rust-cargo-make@v1
# - name: Check deps with machete
# run: cd src-tauri/ ; cargo make deps
110 changes: 110 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: 🚀 Build and Release

on:
push:
tags:
- "v*"

env:
CARGO_TERM_COLOR: always

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
name: 🚀 Build release
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf libudev-dev
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build release
run: npm install -g typescript ; npm install ; cargo install tauri-cli ; cargo tauri build

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: release-${{ matrix.os }}
path: |
src-tauri/target/release/bundle/**/*

release:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Download Artifacts
uses: actions/download-artifact@v2

- name: Zip Artifacts
run: |
mkdir -p release-ubuntu-latest
mv ubuntu-latest/* release-ubuntu-latest/
zip -r release-ubuntu-latest.zip release-ubuntu-latest/

mkdir -p release-macos-latest
mv macos-latest/* release-macos-latest/
zip -r release-macos-latest.zip release-macos-latest/

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF#refs/tags/} | sed 's/[^0-9.]*//g')
shell: bash

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false

- name: Upload Release Asset (ubuntu)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release-ubuntu-latest.zip
asset_name: release-ubuntu-latest.zip
asset_content_type: application/zip

- name: Upload Release Asset (macos)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release-macos-latest.zip
asset_name: release-macos-latest.zip
asset_content_type: application/zip
Loading