feat(ci): add gobuild and docker release workflow

This commit is contained in:
2025-11-19 22:55:35 +01:00
parent 8c1d1355c9
commit f6b545de76
4 changed files with 77 additions and 3 deletions

View File

@@ -0,0 +1,45 @@
name: build
on:
push:
branches-ignore:
- main
env:
VERSION: ${{ github.ref_name }}-${{ github.sha[0:7] }}
jobs:
Gradle-Build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '^1.24.9'
- name: Download Dependencies
run: go mod download
- name: Build linux-amd64
run: GOOS=linux GOARCH=amd64 go build -v -o out/svg-templater_linux-amd64-${{ env.VERSION }} ./...
- name: Build linux-arm64
run: GOOS=linux GOARCH=arm64 go build -v -o out/svg-templater_linux-arm64-${{ env.VERSION }} ./...
- name: Build win-amd64
run: GOOS=windows GOARCH=amd64 go build -v -o out/svg-templater_win-amd64-${{ env.VERSION }}.exe ./...
- name: Build darwin-amd64
run: GOOS=darwin GOARCH=amd64 go build -v -o out/svg-templater_darwin-amd64-${{ env.VERSION }} ./...
- name: Build darwin-arm64
run: GOOS=darwin GOARCH=arm64 go build -v -o out/svg-templater_linux-arm64-${{ env.VERSION }} ./...
- name: Upload artifact
uses: christopherhx/gitea-upload-artifact@v4
with:
name: artifacts
path: out

View File

@@ -0,0 +1,30 @@
name: docker
on:
push:
pull_request:
branches:
- main
env:
VERSION: ${{ github.ref_name }}-${{ github.sha[0:7] }}
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: tueem/svg-templater:${{ VERSION }}

1
.gitignore vendored
View File

@@ -24,4 +24,3 @@ go.work.sum
# env file
.env

View File

@@ -1,5 +1,5 @@
package main
func main() {
println("Hello World")
}