set execution policy in package cmd #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [main] | |
tags: [v*] | |
pull_request: | |
branches: [main] | |
env: | |
DAEMONROOT: webmesh | |
WEBMESH_VERSION: main | |
WEBMESHD_BUILD_ARGS: --snapshot --clean --id webmeshd | |
GH_TOKEN: ${{ github.token }} | |
VERSION: ${{ startswith(github.ref, 'refs/tags/v') && github.ref_name || '' }} | |
jobs: | |
build: | |
name: Build Package | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [linux, mac, win] | |
include: | |
- target: linux | |
runner: ${{ vars.LINUX_BUILD_PLATFORM }} | |
- target: mac | |
runner: ${{ vars.MACOS_BUILD_PLATFORM }} | |
- target: win | |
runner: ${{ vars.WINDOWS_BUILD_PLATFORM }} | |
runs-on: ${{ matrix.runner }} | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout Webmesh | |
uses: actions/checkout@v4 | |
with: | |
repository: webmeshproj/webmesh | |
ref: ${{ env.WEBMESH_VERSION }} | |
path: ${{ env.DAEMONROOT }} | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: stable | |
check-latest: true | |
cache: ${{ !startswith(matrix.runner, 'self-hosted') && matrix.target != 'mac' }} | |
cache-dependency-path: ${{ env.DAEMONROOT }}/go.sum | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
check-latest: true | |
node-version-file: .nvmrc | |
- name: Install UPX on Hosted macOS Runners | |
if: ${{ matrix.target == 'mac' && !startsWith(matrix.runner, 'self-hosted') }} | |
run: brew install upx | |
- name: Build Webmesh Helper Daemon | |
if: ${{ matrix.target != 'linux' }} | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: latest | |
workdir: ${{ env.DAEMONROOT }} | |
args: build ${{ env.WEBMESHD_BUILD_ARGS }} | |
- name: Build Electron App | |
run: yarn && yarn build:${{ matrix.target }} | |
- name: Package App Installer | |
run: yarn package:${{ matrix.target }} |