.gitea/workflows/build.yaml aktualisiert
All checks were successful
Build go program / Explore-Gitea-Actions (push) Successful in 1m18s
All checks were successful
Build go program / Explore-Gitea-Actions (push) Successful in 1m18s
This commit is contained in:
@@ -1,34 +1,50 @@
|
|||||||
name: Gitea Actions Demo
|
name: Build go program
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
run-name: ${{ gitea.actor }} is building go program
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
|
env:
|
||||||
|
APP_NAME: test
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
Explore-Gitea-Actions:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set temp dir
|
- name: Check out repo code
|
||||||
run: mkdir /tmp/git-temp && export GIT_TEMP_DIR=/tmp/git-temp
|
|
||||||
|
|
||||||
- name: Clone repo
|
|
||||||
run: git clone https://gitea.tecamino.com/${{ gitea.repository }}
|
|
||||||
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GT_TOKEN }}
|
token: ${{ secrets.GT_TOKEN }}
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '1.24.5'
|
go-version: '1.24.5'
|
||||||
|
|
||||||
- name: Build Go project
|
|
||||||
run: |
|
|
||||||
go version
|
|
||||||
go build -v -o bin .
|
|
||||||
|
|
||||||
- name: Upload binary as artifact
|
- name: Build Go for Linux AMD64
|
||||||
|
run: |
|
||||||
|
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/${APP_NAME}-linux-amd64
|
||||||
|
|
||||||
|
- name: Upload Linux AMD64 binary
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: go-binary
|
name: go-binary-linux-amd64
|
||||||
path: bin
|
path: bin/${APP_NAME}-linux-amd64
|
||||||
|
|
||||||
|
- name: Build Go for Windows AMD64
|
||||||
|
run: |
|
||||||
|
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o bin/${APP_NAME}-windows-amd64.exe
|
||||||
|
|
||||||
|
- name: Upload Windows AMD64 binary
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: go-binary-windows-amd64
|
||||||
|
path: bin/${APP_NAME}-windows-amd64.exe
|
||||||
|
|
||||||
|
- name: Build Go for Linux ARM64
|
||||||
|
run: |
|
||||||
|
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o bin/${APP_NAME}-linux-arm64
|
||||||
|
|
||||||
|
- name: Upload Linux ARM64 binary
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: go-binary-linux-arm64
|
||||||
|
path: bin/${APP_NAME}-linux-arm64
|
||||||
|
Reference in New Issue
Block a user