Compare commits
4 Commits
v0.0.6-alp
...
v0.0.6-bet
| Author | SHA1 | Date | |
|---|---|---|---|
| 73eec41573 | |||
| 140c98dcd3 | |||
| 23d1aaad55 | |||
| 469e737bb3 |
67
.github/workflows/github-actions.yml
vendored
Normal file
67
.github/workflows/github-actions.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
name: Build and Release Go App
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
# tags:
|
||||||
|
# - 'v*' # Runs only when a new version tag is pushed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build Go App
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
goarch: [amd64]
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
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' || '' }}
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: app-${{ env.GOOS }}-${{ env.GOARCH }}
|
||||||
|
path: dist/*
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Create GitHub Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: dist/**/*
|
||||||
|
draft: true
|
||||||
|
prerelease: false
|
||||||
|
generate_release_notes: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
src/alma
|
src/alma
|
||||||
|
alma
|
||||||
|
|||||||
Reference in New Issue
Block a user