1 Commits

Author SHA1 Message Date
8e30741e37 ci: Initial build script 2025-03-03 06:32:17 +01:00
20 changed files with 5 additions and 13 deletions

View File

@@ -2,8 +2,8 @@ name: Build and Release Go App
on:
push:
# tags:
# - 'v*' # Runs only when a new version tag is pushed
tags:
- 'v*' # Runs only when a new version tag is pushed
jobs:
build:
@@ -23,27 +23,20 @@ jobs:
go-version: '1.21'
- name: Set environment variables
if: runner.os != 'Windows'
run: |
echo "GOOS=${{ runner.os == 'Windows' && 'windows' || runner.os == 'macos' && 'darwin' || 'linux' }}" >> $GITHUB_ENV
echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV
- name: Set environment variables
if: runner.os == 'Windows'
run: |
Add-Content -Path $env:GITHUB_ENV "GOOS=${{ runner.os == 'Windows' && 'windows' || runner.os == 'macos' && 'darwin' || 'linux' }}"
Add-Content -Path $env:GITHUB_ENV "GOARCH=${{ matrix.goarch }}"
- name: Build application
run: |
mkdir -p dist
go build -o dist/alma-${{ env.GOOS }}-${{ env.GOARCH }}${{ env.GOOS == 'windows' && '.exe' || '' }}
go build -C ./src -o dist/alma-${{ env.GOOS }}-${{ env.GOARCH }}${{ env.GOOS == 'windows' && '.exe' || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: app-${{ env.GOOS }}-${{ env.GOARCH }}
path: dist/*
path: src/dist/*
release:
name: Create GitHub Release
@@ -59,7 +52,7 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: dist/**/*
draft: true
draft: false
prerelease: false
generate_release_notes: true
env:

1
.gitignore vendored
View File

@@ -1,2 +1 @@
src/alma
alma

View File

View File

View File