Skip to content

Prepare everything for v1.0 #231

Prepare everything for v1.0

Prepare everything for v1.0 #231

Workflow file for this run

name: Build Compotes app.
on:
push:
branches: [ main ]
tags: [ 'v[0-9]+.*' ]
pull_request:
branches: [ main ]
jobs:
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: 18
- name: 🍃 Install Yarn
run: |
npm i -g npm yarn
- 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
- name: 🗃 Store artifacts (release only)
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/v')
with:
name: compotes_artifacts_${{ matrix.os }}
overwrite: true
path: |
src-tauri/target/release/compotes
src-tauri/target/release/bundle/deb/*.deb
- name: 🗃 Store Windows artifacts (release only)
uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
with:
name: compotes_artifacts_${{ matrix.os }}
overwrite: true
path: |
src-tauri/target/release/compotes.exe
src-tauri/target/release/bundle/msi/*.msi
release:
runs-on: ubuntu-latest
needs:
- build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
#body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: 🗃 Download built artifacts
uses: actions/download-artifact@v4
with:
path: src-tauri/target/release
merge-multiple: true
- name: Upload Windows executable
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src-tauri/target/release/compotes.exe
asset_name: compotes_${{ github.ref_name }}.exe
tag: ${{ github.ref_name }}
overwrite: true
file_glob: true
- name: Upload Windows installer
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src-tauri/target/release/bundle/msi/compotes_*.msi
asset_name: compotes_${{ github.ref_name }}_installer.msi
tag: ${{ github.ref_name }}
overwrite: true
file_glob: true
- name: Upload Linux executable
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src-tauri/target/release/compotes
asset_name: compotes_${{ github.ref_name }}
tag: ${{ github.ref_name }}
overwrite: true
file_glob: true
- name: Upload Linux deb package
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: src-tauri/target/release/bundle/deb/compotes_*.deb
asset_name: compotes_${{ github.ref_name }}.deb
tag: ${{ github.ref_name }}
overwrite: true
file_glob: true