1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66# 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: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24.2'
- name: Test
run: go test -v ./...
build:
name: Build
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, windows, darwin]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24.2'
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
OUTPUT_NAME=gitea-bulk-migration
if [ "${{ matrix.os }}" = "windows" ]; then
OUTPUT_NAME=gitea-bulk-migration.exe
fi
go build -v -o $OUTPUT_NAME
mkdir -p dist
tar -czf dist/gitea-bulk-migration-${{ matrix.os }}-${{ matrix.arch }}.tar.gz $OUTPUT_NAME
echo "Built for ${{ matrix.os }}-${{ matrix.arch }}"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: gitea-bulk-migration-${{ matrix.os }}-${{ matrix.arch }}
path: dist/gitea-bulk-migration-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
retention-days: 7