refactor: adjust indentation and formatting in release-builds.yml

This commit is contained in:
Andy Dixon
2026-04-22 15:14:05 +01:00
parent 7f63928dd8
commit 382f3ca8af
+116 -116
View File
@@ -1,137 +1,137 @@
name: Release Builds name: Release Builds
on: on:
push: push:
tags: tags:
- "v*" - "v*"
workflow_dispatch: workflow_dispatch:
permissions: permissions:
contents: write contents: write
jobs: jobs:
build: build:
name: Build ${{ matrix.platform }} name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- platform: darwin/amd64 - platform: darwin/amd64
runner: macos-13 runner: macos-13
os: darwin os: darwin
arch: amd64 arch: amd64
archive_type: zip archive_type: zip
- platform: darwin/arm64 - platform: darwin/arm64
runner: macos-14 runner: macos-14
os: darwin os: darwin
arch: arm64 arch: arm64
archive_type: zip archive_type: zip
- platform: linux/amd64 - platform: linux/amd64
runner: ubuntu-latest runner: ubuntu-latest
os: linux os: linux
arch: amd64 arch: amd64
archive_type: tar archive_type: tar
- platform: linux/arm64 - platform: linux/arm64
runner: ubuntu-24.04-arm64 runner: ubuntu-24.04-arm64
os: linux os: linux
arch: arm64 arch: arm64
archive_type: tar archive_type: tar
- platform: windows/amd64 - platform: windows/amd64
runner: windows-latest runner: windows-latest
os: windows os: windows
arch: amd64 arch: amd64
archive_type: zip archive_type: zip
- platform: windows/arm64 - platform: windows/arm64
runner: ubuntu-latest runner: ubuntu-latest
os: windows os: windows
arch: arm64 arch: arm64
archive_type: zip archive_type: zip
cross: true cross: true
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version-file: go.mod go-version-file: go.mod
- name: Set up Node - name: Set up Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: "20" node-version: "20"
- name: Install Wails - name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Install frontend dependencies - name: Install frontend dependencies
run: npm install run: npm install
working-directory: frontend working-directory: frontend
- name: Install Linux build dependencies - name: Install Linux build dependencies
if: matrix.os == 'linux' if: matrix.os == 'linux'
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev
- name: Install Windows cross-compiler - name: Install Windows cross-compiler
if: matrix.os == 'windows' && matrix.cross if: matrix.os == 'windows' && matrix.cross
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-aarch64 zip sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-aarch64 zip
- name: Build (non-Windows runners) - name: Build (non-Windows runners)
if: matrix.runner != 'windows-latest' if: matrix.runner != 'windows-latest'
env: env:
CGO_ENABLED: "1" CGO_ENABLED: "1"
run: | run: |
if [ "${{ matrix.os }}" = "windows" ] && [ "${{ matrix.cross }}" = "true" ]; then if [ "${{ matrix.os }}" = "windows" ] && [ "${{ matrix.cross }}" = "true" ]; then
export CC=aarch64-w64-mingw32-gcc export CC=aarch64-w64-mingw32-gcc
fi fi
wails build -platform "${{ matrix.platform }}" -ldflags "-s -w" wails build -platform "${{ matrix.platform }}" -ldflags "-s -w"
- name: Build (Windows runner) - name: Build (Windows runner)
if: matrix.runner == 'windows-latest' if: matrix.runner == 'windows-latest'
shell: pwsh shell: pwsh
env: env:
CGO_ENABLED: "1" CGO_ENABLED: "1"
run: | run: |
wails build -platform "${{ matrix.platform }}" -ldflags "-s -w" wails build -platform "${{ matrix.platform }}" -ldflags "-s -w"
- name: Package (zip) - name: Package (zip)
if: matrix.archive_type == 'zip' && matrix.runner != 'windows-latest' if: matrix.archive_type == 'zip' && matrix.runner != 'windows-latest'
run: | run: |
archive="nexus-terminal-${{ matrix.platform }}.zip" archive="nexus-terminal-${{ matrix.platform }}.zip"
cd build/bin cd build/bin
zip -r "../../${archive}" . zip -r "../../${archive}" .
- name: Package (tar) - name: Package (tar)
if: matrix.archive_type == 'tar' if: matrix.archive_type == 'tar'
run: | run: |
archive="nexus-terminal-${{ matrix.platform }}.tar.gz" archive="nexus-terminal-${{ matrix.platform }}.tar.gz"
tar -czf "${archive}" -C build/bin . tar -czf "${archive}" -C build/bin .
- name: Package (Windows zip) - name: Package (Windows zip)
if: matrix.archive_type == 'zip' && matrix.runner == 'windows-latest' if: matrix.archive_type == 'zip' && matrix.runner == 'windows-latest'
shell: pwsh shell: pwsh
run: | run: |
$archive = "nexus-terminal-${{ matrix.platform }}.zip" $archive = "nexus-terminal-${{ matrix.platform }}.zip"
Compress-Archive -Path "build/bin/*" -DestinationPath $archive Compress-Archive -Path "build/bin/*" -DestinationPath $archive
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: nexus-terminal-${{ matrix.platform }} name: nexus-terminal-${{ matrix.platform }}
path: | path: |
nexus-terminal-${{ matrix.platform }}.zip nexus-terminal-${{ matrix.platform }}.zip
nexus-terminal-${{ matrix.platform }}.tar.gz nexus-terminal-${{ matrix.platform }}.tar.gz
- name: Attach to GitHub Release - name: Attach to GitHub Release
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
files: | files: |
nexus-terminal-${{ matrix.platform }}.zip nexus-terminal-${{ matrix.platform }}.zip
nexus-terminal-${{ matrix.platform }}.tar.gz nexus-terminal-${{ matrix.platform }}.tar.gz