Skip to content

v1.0.0

v1.0.0 #14

Workflow file for this run

name: Release Builds
on:
release:
types: [created]
permissions: write-all
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22.3"]
os: [linux, windows, darwin]
arch: [amd64, arm64]
include:
- os: windows
extension: .exe
- os: linux
extension: ""
- os: darwin
extension: ""
name: Build for ${{ matrix.os }}/${{ matrix.arch }}
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies for GUI
run: |
sudo apt install -y gcc pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev
- name: Test CLI
working-directory: ./cli
run: go test -v
- name: Test GUI
working-directory: ./gui
run: go test -v
- name: Build CLI
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
working-directory: ./cli
run: |
go build -o ../mhmods-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.extension }}
- name: Build GUI
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
working-directory: ./gui
run: |
go build -o ../mhmods-gui-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.extension }}
- name: Compress CLI binary
run: |
FILES="mhmods-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.extension }}"
[ -f LICENSE ] && FILES="$FILES LICENSE"
[ -f README.md ] && FILES="$FILES README.md"
tar -czvf mhmods-${{ matrix.os }}-${{ matrix.arch }}.tar.gz $FILES
- name: Compress GUI binary
run: |
FILES="mhmods-gui-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.extension }}"
[ -f LICENSE ] && FILES="$FILES LICENSE"
[ -f README.md ] && FILES="$FILES README.md"
tar -czvf mhmods-gui-${{ matrix.os }}-${{ matrix.arch }}.tar.gz $FILES
- name: Upload CLI binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: mhmods-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_name: mhmods-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip
- name: Upload GUI binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: mhmods-gui-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_name: mhmods-gui-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip