4 Commits

Author SHA1 Message Date
73eec41573 ci: fix windows env vars 2025-03-03 07:28:26 +01:00
140c98dcd3 ci: remove src 2025-03-03 06:56:06 +01:00
23d1aaad55 chore: move everything out from src 2025-03-03 06:52:47 +01:00
469e737bb3 ci: Initial build script 2025-03-03 06:39:20 +01:00
20 changed files with 13 additions and 5 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,20 +23,27 @@ 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 -C ./src -o dist/alma-${{ env.GOOS }}-${{ env.GOARCH }}${{ env.GOOS == 'windows' && '.exe' || '' }}
go build -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: src/dist/*
path: dist/*
release:
name: Create GitHub Release
@@ -52,7 +59,7 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: dist/**/*
draft: false
draft: true
prerelease: false
generate_release_notes: true
env:

1
.gitignore vendored
View File

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

View File

View File

View File