1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 21:17:59 +00:00
rolens/.github/workflows/ci.yml

102 lines
2.4 KiB
YAML
Raw Normal View History

2023-05-30 13:25:47 +00:00
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build Rolens
strategy:
2023-05-30 19:03:36 +00:00
fail-fast: false
2023-05-30 13:25:47 +00:00
matrix:
2023-06-03 09:43:54 +00:00
platform:
- windows-2019
- windows-2022
- macos-12
- macos-13
2024-08-04 10:37:35 +00:00
- macos-14
2023-06-03 09:43:54 +00:00
- ubuntu-20.04
- ubuntu-22.04
2024-08-04 10:37:35 +00:00
- ubuntu-24.04
2023-12-22 13:15:46 +00:00
go-version: [ 1.21 ]
2023-12-23 12:20:51 +00:00
node-version: [ 18 ]
2023-05-30 13:25:47 +00:00
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
2023-05-30 19:52:54 +00:00
cache-dependency-path: go.sum
2023-05-30 13:25:47 +00:00
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Install build dependencies for macOS
if: contains(matrix.platform, 'macos')
run: npm install --global appdmg
- name: Install build dependencies for Linux
2023-06-03 09:43:54 +00:00
if: contains(matrix.platform, 'ubuntu')
2023-06-02 15:41:57 +00:00
run: sudo apt-get install gtk+-3.0 webkit2gtk-4.0
2023-06-02 15:29:35 +00:00
2023-05-30 13:25:47 +00:00
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
2023-05-30 19:52:54 +00:00
cache: npm
cache-dependency-path: frontend/package-lock.json
2023-05-30 13:25:47 +00:00
- name: Cross-compile Rolens for Windows
2023-06-03 09:43:54 +00:00
if: contains(matrix.platform, 'windows')
run: ./build/windows/ci_generate.ps1 -platform "${{ matrix.platform }}"
2023-05-30 13:25:47 +00:00
- name: Cross-compile Rolens for Darwin
2023-06-03 09:43:54 +00:00
if: contains(matrix.platform, 'macos')
run: ./build/darwin/ci_generate.sh "${{ matrix.platform }}"
- name: Cross-compile Rolens for Linux
2023-06-03 09:43:54 +00:00
if: contains(matrix.platform, 'ubuntu')
run: ./build/linux/ci_generate.sh "${{ matrix.platform }}"
- name: Upload generated binaries
2024-08-04 10:38:14 +00:00
uses: actions/upload-artifact@v4
with:
2023-06-03 09:43:54 +00:00
name: rolens-${{ matrix.platform }}
path: releases/*
- name: Test build script for users
2023-06-30 18:09:36 +00:00
run: node ./build.js
bundle:
name: Bundle artifacts
runs-on: ubuntu-22.04
2023-06-22 09:04:39 +00:00
needs: build
if: ${{ always() }}
steps:
2023-06-23 12:34:49 +00:00
- name: Checkout
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Place all tarballs in the same directory
2023-06-23 12:34:49 +00:00
run: build/ci_bundle.sh
- name: Upload the bundle as an artifact
2024-08-04 10:38:14 +00:00
uses: actions/upload-artifact@v4
with:
name: rolens-bundle
path: bundle