68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
name: build
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
gotify:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: 1.25.x
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22'
|
|
- uses: actions/checkout@v5
|
|
- run: (cd ui && yarn)
|
|
- run: make build-js
|
|
- uses: golangci/golangci-lint-action@v8
|
|
with:
|
|
version: v2.4.0
|
|
args: --timeout=5m
|
|
skip-cache: true
|
|
- run: go mod download
|
|
- run: make download-tools
|
|
- run: make test
|
|
- run: make check-ci
|
|
- uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
export LD_FLAGS="-w -s -X main.Version=$VERSION -X main.BuildDate=$(date "+%F-%T") -X main.Commit=$(git rev-parse --verify HEAD) -X main.Mode=prod"
|
|
echo "LD_FLAGS=$LD_FLAGS" >> $GITHUB_ENV
|
|
|
|
make build
|
|
sudo chown -R $UID build
|
|
make package-zip
|
|
ls -lath build
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ secrets.DOCKER_GHCR_USER }}
|
|
password: ${{ secrets.DOCKER_GHCR_PASS }}
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
run: |
|
|
make DOCKER_BUILD_PUSH=true build-docker
|
|
- if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: build/*.zip
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
file_glob: true
|