2023-05-30 13:25:47 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
2023-06-03 08:18:01 +00:00
|
|
|
workflow_dispatch:
|
2023-05-30 13:25:47 +00:00
|
|
|
|
|
|
|
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-11
|
|
|
|
- macos-12
|
|
|
|
- macos-13
|
|
|
|
- ubuntu-20.04
|
|
|
|
- ubuntu-22.04
|
2023-05-30 13:25:47 +00:00
|
|
|
go-version: [1.18]
|
|
|
|
node-version: [16]
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-06-04 15:11:13 +00:00
|
|
|
- name: Install build dependencies for macOS
|
|
|
|
if: contains(matrix.platform, 'macos')
|
|
|
|
run: brew install create-dmg
|
|
|
|
|
|
|
|
- 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
|
|
|
|
2023-06-03 08:18:01 +00:00
|
|
|
- name: Cross-compile Rolens for Windows
|
2023-06-03 09:43:54 +00:00
|
|
|
if: contains(matrix.platform, 'windows')
|
2023-06-04 15:11:13 +00:00
|
|
|
run: ./build/windows/ci_generate.ps1 -platform "${{ matrix.platform }}"
|
2023-05-30 13:25:47 +00:00
|
|
|
|
2023-06-03 08:18:01 +00:00
|
|
|
- name: Cross-compile Rolens for Darwin
|
2023-06-03 09:43:54 +00:00
|
|
|
if: contains(matrix.platform, 'macos')
|
2023-06-04 15:11:13 +00:00
|
|
|
run: ./build/darwin/ci_generate.sh "${{ matrix.platform }}"
|
2023-06-03 08:18:01 +00:00
|
|
|
|
|
|
|
- name: Cross-compile Rolens for Linux
|
2023-06-03 09:43:54 +00:00
|
|
|
if: contains(matrix.platform, 'ubuntu')
|
2023-06-04 15:11:13 +00:00
|
|
|
run: ./build/linux/ci_generate.sh "${{ matrix.platform }}"
|
2023-06-03 08:18:01 +00:00
|
|
|
|
2023-06-03 08:59:08 +00:00
|
|
|
- name: Upload generated binaries
|
2023-06-03 08:18:01 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2023-06-03 09:43:54 +00:00
|
|
|
name: rolens-${{ matrix.platform }}
|
2023-06-03 08:59:08 +00:00
|
|
|
path: releases/*
|
2023-06-03 15:59:17 +00:00
|
|
|
|
|
|
|
bundle:
|
|
|
|
name: Bundle artifacts
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: artifacts
|
|
|
|
|
|
|
|
- name: Place all tarballs in the same directory
|
|
|
|
run: |
|
|
|
|
mkdir bundle
|
2023-06-03 16:32:30 +00:00
|
|
|
mv artifacts/*/* bundle
|
2023-06-03 15:59:17 +00:00
|
|
|
|
|
|
|
- name: Upload the bundle as an artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: rolens-bundle
|
|
|
|
path: bundle
|