2023-08-30 13:13:57 +00:00
|
|
|
name: mozhi pipeline
|
2023-08-30 12:54:08 +00:00
|
|
|
on: push
|
|
|
|
jobs:
|
2023-08-30 13:13:57 +00:00
|
|
|
push_to_registry:
|
2023-08-30 12:54:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-08-30 13:13:57 +00:00
|
|
|
name: Push Docker image to Codeberg docker registry
|
2023-08-30 12:54:08 +00:00
|
|
|
steps:
|
2023-09-21 16:28:53 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
2023-08-30 12:54:08 +00:00
|
|
|
with:
|
|
|
|
username: aryak
|
|
|
|
password: ${{ secrets.MOZHI_DOCKER_PASSWORD }}
|
2023-08-30 12:55:27 +00:00
|
|
|
registry: codeberg.org
|
2023-08-30 13:13:57 +00:00
|
|
|
- name: Build and push Docker image
|
2023-09-21 16:28:53 +00:00
|
|
|
uses: docker/build-push-action@v5
|
2023-08-30 12:54:08 +00:00
|
|
|
with:
|
2023-08-30 13:13:57 +00:00
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
2023-08-30 12:54:08 +00:00
|
|
|
push: true
|
2023-08-30 13:55:32 +00:00
|
|
|
tags: codeberg.org/aryak/mozhi:latest
|
2023-09-21 16:23:49 +00:00
|
|
|
platforms: linux/amd64, linux/arm64
|
2023-08-30 14:18:57 +00:00
|
|
|
build_artifact:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Build and publish artifacts
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup Go compiler
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: '1.21'
|
|
|
|
|
|
|
|
- name: Build mozhi
|
|
|
|
run: |
|
2023-09-11 08:45:27 +00:00
|
|
|
export GOPRIVATE=codeberg.org/aryak/libmozhi
|
2023-08-30 14:18:57 +00:00
|
|
|
go mod download
|
2023-09-09 14:33:14 +00:00
|
|
|
go run github.com/swaggo/swag/cmd/swag@latest init --parseDependency
|
2023-08-30 14:18:57 +00:00
|
|
|
GOOS=linux GOARCH=amd64 go build -o mozhi-linux-amd64
|
|
|
|
GOOS=linux GOARCH=arm64 go build -o mozhi-linux-arm64
|
|
|
|
GOOS=windows GOARCH=amd64 go build -o mozhi-windows-amd64.exe
|
|
|
|
GOOS=windows GOARCH=arm64 go build -o mozhi-windows-arm64.exe
|
|
|
|
GOOS=darwin GOARCH=amd64 go build -o mozhi-darwin-amd64
|
|
|
|
GOOS=darwin GOARCH=arm64 go build -o mozhi-darwin-arm64
|
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: mozhi-linux-amd64
|
|
|
|
path: mozhi-linux-amd64
|
2023-08-30 14:21:50 +00:00
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-08-30 14:18:57 +00:00
|
|
|
name: mozhi-linux-arm64
|
|
|
|
path: mozhi-linux-arm64
|
|
|
|
|
2023-08-30 14:21:50 +00:00
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-08-30 14:18:57 +00:00
|
|
|
name: mozhi-windows-amd64.exe
|
|
|
|
path: mozhi-windows-amd64.exe
|
2023-08-30 14:21:50 +00:00
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-08-30 14:18:57 +00:00
|
|
|
name: mozhi-windows-arm64.exe
|
|
|
|
path: mozhi-windows-arm64.exe
|
|
|
|
|
2023-08-30 14:21:50 +00:00
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-08-30 14:18:57 +00:00
|
|
|
name: mozhi-darwin-amd64
|
|
|
|
path: mozhi-darwin-amd64
|
2023-08-30 14:21:50 +00:00
|
|
|
- name: Archive production artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-08-30 14:18:57 +00:00
|
|
|
name: mozhi-darwin-arm64
|
|
|
|
path: mozhi-darwin-arm64
|