Skip to content

Workflow file for this run

name: Build and Release
on:
push:
tags:
- "v*.*.*" # trigger when tag is vX.X.X
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
extension: ""
- os: macos-latest
goos: darwin
extension: ".app"
- os: windows-latest
goos: windows
extension: ".exe"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Add Go bin to PATH
run: echo "${{ github.workspace }}/go/bin" >> $GITHUB_PATH
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install frontend dependencies
run: |
cd frontend
npm install
- name: Install Wails
run: |
go install github.com/wailsapp/wails/v2/cmd/wails@latest
env:
GOPATH: ${{ github.workspace }}/go
- name: Install Go Dependencies
run: |
go mod tidy
env:
GOPATH: ${{ github.workspace }}/go
- name: Build Wails App
run: |
wails build -m release
env:
GOOS: ${{ matrix.goos }}
GOARCH: "amd64"
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: crypto-monitor-${{ matrix.os }}
path: |
build/bin/crypto-monitor${{ matrix.extension }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v3
with:
name: crypto-monitor-ubuntu-latest
path: ./build/linux
- name: Download macOS artifact
uses: actions/download-artifact@v3
with:
name: crypto-monitor-macos-latest
path: ./build/macos
- name: Download Windows artifact
uses: actions/download-artifact@v3
with:
name: crypto-monitor-windows-latest
path: ./build/windows
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/windows/crypto-monitor.exe
asset_name: crypto-monitor-windows-v${{ github.ref_name }}.exe
asset_content_type: application/vnd.microsoft.package
- name: Upload macOS Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/macos/crypto-monitor.app
asset_name: crypto-monitor-macos-v${{ github.ref_name }}.app
asset_content_type: application/x-apple-app
- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/linux/crypto-monitor
asset_name: crypto-monitor-linux-v${{ github.ref_name }}
asset_content_type: application/octet-stream