Compare commits
1 Commits
main
...
v0.0.6-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e30741e37 |
17
.github/workflows/github-actions.yml
vendored
17
.github/workflows/github-actions.yml
vendored
@@ -2,8 +2,8 @@ name: Build and Release Go App
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# tags:
|
tags:
|
||||||
# - 'v*' # Runs only when a new version tag is pushed
|
- 'v*' # Runs only when a new version tag is pushed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -23,27 +23,20 @@ jobs:
|
|||||||
go-version: '1.21'
|
go-version: '1.21'
|
||||||
|
|
||||||
- name: Set environment variables
|
- name: Set environment variables
|
||||||
if: runner.os != 'Windows'
|
|
||||||
run: |
|
run: |
|
||||||
echo "GOOS=${{ runner.os == 'Windows' && 'windows' || runner.os == 'macos' && 'darwin' || 'linux' }}" >> $GITHUB_ENV
|
echo "GOOS=${{ runner.os == 'Windows' && 'windows' || runner.os == 'macos' && 'darwin' || 'linux' }}" >> $GITHUB_ENV
|
||||||
echo "GOARCH=${{ matrix.goarch }}" >> $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
|
- name: Build application
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
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
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: app-${{ env.GOOS }}-${{ env.GOARCH }}
|
name: app-${{ env.GOOS }}-${{ env.GOARCH }}
|
||||||
path: dist/*
|
path: src/dist/*
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Create GitHub Release
|
name: Create GitHub Release
|
||||||
@@ -59,7 +52,7 @@ jobs:
|
|||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: dist/**/*
|
files: dist/**/*
|
||||||
draft: true
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
env:
|
env:
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1 @@
|
|||||||
src/alma
|
src/alma
|
||||||
alma
|
|
||||||
|
|||||||
Reference in New Issue
Block a user