Skip to content

Commit

Permalink
Posible build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Astrak00 committed Aug 2, 2024
1 parent 896fbe9 commit d87ce5e
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
arch: [amd64, arm64]
exclude:
- os: windows-latest
arch: arm64

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20

- name: Check out code
uses: actions/checkout@v3

- name: Set up environment
run: |
echo "GOOS=$(echo ${{ matrix.os }} | awk -F'-' '{print $1}')" >> $GITHUB_ENV
echo "GOARCH=${{ matrix.arch }}" >> $GITHUB_ENV
if [ "${{ matrix.os }}" == "windows-latest" ]; then
echo "EXT=.exe" >> $GITHUB_ENV
else
echo "EXT=" >> $GITHUB_ENV
fi
- name: Build
run: |
go build -o myprogram_${{ env.GOOS }}_${{ env.GOARCH }}${{ env.EXT }} .
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: myprogram
path: |
myprogram_*

0 comments on commit d87ce5e

Please sign in to comment.