generated from habedi/template-go-project
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (53 loc) · 1.89 KB
/
build_macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: MacOS Build
on:
workflow_dispatch:
push:
tags:
- 'v*' # Trigger on version tags (e.g., v1.0.0)
jobs:
build:
runs-on: macos-latest
steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23
# Install dependencies and run the tests
- name: Install Dependencies
run: |
brew install make
make format
make test
continue-on-error: false
# Build the application
- name: Build for MacOS
run: |
make build-macos
continue-on-error: false
# Debug: List Build Directory
- name: List Build Directory
run: ls -R bin
# Upload Build Artifact (always runs)
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: gogg-macos-universal
path: 'bin/gogg'
# Conditional Release Creation (only runs on tag push)
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: "bin/gogg"
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.ref_name }}
tag: ${{ github.ref_name }}
body: |
Release version ${{ github.ref_name }}
- Built for macOS Universal Binary
draft: false
prerelease: false