mirror of
https://github.com/gotify/server.git
synced 2026-05-08 14:26:56 +08:00
* chore(deps): update golangci/golangci-lint-action action to v8 * Bump golangci-lint to v2.2.1 Signed-off-by: eternal-flame-AD <yume@yumechi.jp> --------- Signed-off-by: eternal-flame-AD <yume@yumechi.jp> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: eternal-flame-AD <yume@yumechi.jp>
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@v5
|
|
with:
|
|
go-version: 1.24.x
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
- uses: actions/checkout@v4
|
|
- run: (cd ui && yarn)
|
|
- run: make build-js
|
|
- uses: golangci/golangci-lint-action@v8
|
|
with:
|
|
version: v2.2.1
|
|
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
|