Skip to content

Prepare everything for v1.0 #202

Prepare everything for v1.0

Prepare everything for v1.0 #202

Workflow file for this run

name: Build Compotes app.
on:
push:
branches: [ main ]
tags: [ 'v[0-9]+.*' ]
pull_request:
branches: [ main ]
jobs:
create-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
# (optional) Path to changelog.
changelog: CHANGELOG.md
# (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: 🗄️ Setup Rust cache
uses: actions/cache@v2
with:
key: ${{ matrix.os }}-${{ hashFiles('src-tauri/Cargo.lock') }}
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git
./src-tauri/target
- name: 🍃 Install Node.js
uses: actions/setup-node@v2
with:
node-version: 16
cache: yarn
cache-dependency-path: |
yarn.lock
tests/webdriverio/yarn.lock
- name: 🦀 Install Rust
uses: actions-rs/toolchain@v1
with: { toolchain: stable }
- name: 🌐 Update MSEdge webdriver (windowsonly)
if: matrix.os == 'windows-latest'
run: |
choco upgrade microsoft-edge
- name: 🌐 Install webkit2gtk (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get upgrade -y --no-install-recommends -y libgtk-3-dev libgtksourceview-3.0-dev webkit2gtk-4.0 libappindicator3-dev webkit2gtk-driver xvfb
- name: 🔌 Install Node.js dependencies
run: yarn install
- name: 🔌 Download Rust dependencies
run: cargo fetch --manifest-path=src-tauri/Cargo.toml
- name: 🏗️ 📄 Build frontend
run: yarn build
- name: 🏗️ 💽 Build application
run: yarn tauri build
- name: 🧪 Test application (linux)
if: matrix.os == 'ubuntu-latest'
continue-on-error: true
run: |
xvfb-run yarn test
- name: 🧪 Test application (non-linux)
if: matrix.os != 'ubuntu-latest'
continue-on-error: true
run: |
yarn test
upload-assets:
needs:
- create-release
- build
if: startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: src/target/release/compotes
target: ${{ matrix.target }}
tar: unix
zip: windows
token: ${{ secrets.GITHUB_TOKEN }}
include: LICENSE,README.md
archive: $bin-$tag-$target