Skip to content

同步

同步 #7

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: auto-deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.5'
- name: Install dependencies
working-directory: ./
run: go mod tidy
- name: Build for Linux x64
working-directory: ./
run: GOOS=linux GOARCH=amd64 go build -o build/go-iceinu-linux-amd64-${{ github.sha }} .
- name: Build for Windows x64
working-directory: ./
run: GOOS=windows GOARCH=amd64 go build -o build/go-iceinu-windows-amd64-${{ github.sha }}.exe .
- name: Upload Linux binary
uses: actions/upload-artifact@v3
with:
name: go-iceinu-linux-amd64-${{ github.sha }}
path: ./build/go-iceinu-linux-amd64-${{ github.sha }}
- name: Upload Windows binary
uses: actions/upload-artifact@v3
with:
name: go-iceinu-windows-amd64-${{ github.sha }}
path: ./build/go-iceinu-windows-amd64-${{ github.sha }}.exe