1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-19 05:27:57 +00:00
rolens/.github/workflows/ci.yml

93 lines
3.0 KiB
YAML
Raw Normal View History

2023-05-30 13:25:47 +00:00
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
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-02 15:23:39 +00:00
platform: [windows-2022, macos-12, 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-02 15:29:35 +00:00
- name: Install Wails dependencies for Linux
if: matrix.platform == 'ubuntu-22.04'
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 08:26:17 +00:00
if: matrix.platform == 'windows-2022'
run: |
mkdir releases
wails build -platform windows/amd64
2023-06-03 08:26:17 +00:00
tar -czvf releases\rolens-windows-10+-amd64.tar.gz --directory build\bin Rolens.exe
"tar_amd64=releases/rolens-windows-10+-amd64.tar.gz" >> $env:GITHUB_ENV
rmdir build\bin
wails build -platform windows/arm64
2023-06-03 08:26:17 +00:00
tar -czvf releases\rolens-windows-10+-arm64.tar.gz --directory build\bin Rolens.exe
"tar_amd64=releases/rolens-windows-10+-arm64.tar.gz" >> $env:GITHUB_ENV
2023-05-30 13:25:47 +00:00
- name: Cross-compile Rolens for Darwin
2023-06-03 08:26:17 +00:00
if: matrix.platform == 'macos-12'
run: |
mkdir releases
wails build -platform darwin/amd64
2023-06-03 08:26:17 +00:00
tar -czvf releases/rolens-macos-10.13+-amd64.tar.gz --directory build/bin Rolens.app
echo "tar_amd64=releases/rolens-macos-10.13+-amd64.tar.gz" >> "$GITHUB_ENV"
rm -rf build/bin
wails build -platform darwin/arm64
2023-06-03 08:26:17 +00:00
tar -czvf releases/rolens-11.0+-arm64.tar.gz --directory build/bin Rolens.app
echo "tar_amd64=releases/releases/rolens-11.0+-arm64.tar.gz" >> "$GITHUB_ENV"
- name: Cross-compile Rolens for Linux
run: |
mkdir releases
wails build -platform linux/amd64
2023-06-03 08:26:17 +00:00
tar -czvf releases/rolens-linux-amd64.tar.gz --directory build/bin Rolens
echo "tar_amd64=releases/rolens-linux-amd64.tar.gz" >> "$GITHUB_ENV"
rm -rf build/bin
wails build -platform linux/arm64
2023-06-03 08:26:17 +00:00
tar -czvf releases/rolens-linux-arm64.tar.gz --directory build/bin Rolens
echo "tar_arm64=releases/rolens-linux-arm64.tar.gz" >> "$GITHUB_ENV"
- name: Upload generated amd64 binary
uses: actions/upload-artifact@v2
with:
2023-06-03 08:26:17 +00:00
name: ${{ env.tar_amd64 }}
path: releases/${{ env.tar_amd64 }}
- name: Upload generated arm64 binary
2023-05-30 13:25:47 +00:00
uses: actions/upload-artifact@v2
with:
2023-06-03 08:26:17 +00:00
name: ${{ env.tar_arm64 }}
path: releases/${{ env.tar_arm64 }}