Skip to content

ci: write full version #2599

ci: write full version

ci: write full version #2599

Workflow file for this run

name: build
on: [push, pull_request]
permissions:
contents: write
jobs:
gotify:
runs-on: ubuntu-latest
# Run on push for branches in this repo, and on pull_request only for forks.
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name)
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: GO_VERSION
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
- run: (cd ui && yarn)
- run: make build-js
- uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: v2.15.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@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
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') || startsWith(github.ref, 'refs/heads/master')
name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/master')
name: Set up QEMU
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/master')
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/master')
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
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/heads/master')
run: |
make DOCKER_BUILD_PUSH=true build-docker-multiarch-master
- if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true