feat(ci): add gobuild and docker release workflow
This commit is contained in:
45
.gitea/workflows/gobuild.yaml
Normal file
45
.gitea/workflows/gobuild.yaml
Normal 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
|
||||
30
.gitea/workflows/release-docker.yaml
Normal file
30
.gitea/workflows/release-docker.yaml
Normal 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 }}
|
||||
Reference in New Issue
Block a user