Add bump-go action #333
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
jobs: | |
gotify: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- uses: actions/checkout@v4 | |
- run: (cd ui && yarn) | |
- run: make build-js | |
- uses: golangci/golangci-lint-action@v5 | |
with: | |
version: v1.55 | |
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@v4 | |
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" | |
make build | |
sudo chown -R $UID build | |
make package-zip | |
ls -lath build | |
make build-docker | |
docker image ls | |
echo "$DOCKER_PASS" | docker login --username "$DOCKER_USER" --password-stdin | |
echo "$DOCKER_GHCR_PASS" | docker login ghcr.io --username "$DOCKER_GHCR_USER" --password-stdin | |
docker push --all-tags gotify/server | |
docker push --all-tags gotify/server-arm7 | |
docker push --all-tags gotify/server-arm64 | |
docker push --all-tags gotify/server-riscv64 | |
docker push --all-tags ghcr.io/gotify/server | |
docker push --all-tags ghcr.io/gotify/server-arm7 | |
docker push --all-tags ghcr.io/gotify/server-arm64 | |
docker push --all-tags ghcr.io/gotify/server-riscv64 | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | |
DOCKER_GHCR_USER: ${{ secrets.DOCKER_GHCR_USER }} | |
DOCKER_GHCR_PASS: ${{ secrets.DOCKER_GHCR_PASS }} | |
- 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 |