chore: prepare release files

This commit is contained in:
Damillora 2025-02-24 15:31:37 +00:00
parent 48a8dacbae
commit e5e4725fb4
5 changed files with 135 additions and 1 deletions

43
.github/workflows/release-docker.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: CI
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [linux/amd64,linux/arm64]
env:
IS_LINUX: ${{ startsWith(matrix.platform, 'linux/') && 'true' || 'false' }}
GIT_TAG: ${{ needs.git-version.outputs.git_tag }}
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: damillora/phoebe
flavor: |
latest=false
tags: |
type=semver,pattern={{version}}
- name: Build and push
id: docker_build_git
uses: docker/build-push-action@v6
with:
push: true
platforms: ${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -0,0 +1,28 @@
name: CI
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_CODENAME: ${{ env.RELEASE_CODENAME }}
RELEASE_SUBTITLE: ${{ env.RELEASE_SUBTITLE }}

2
.gitignore vendored
View File

@ -13,3 +13,5 @@
# Dependency directories (remove the comment below to include it) # Dependency directories (remove the comment below to include it)
# vendor/ # vendor/
# Added by goreleaser init:
dist/

62
.goreleaser.yaml Normal file
View File

@ -0,0 +1,62 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
project_name: phoebe
before:
hooks:
# Build frontend first
- sh -c "cd pkg/web && npm ci && npm run build"
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
release:
header: >-
# Version v{{.Version}} "{{ .Env.RELEASE_CODENAME }} - {{ .Env.RELEASE_SUBTITLE }}"
---
footer: >-
---
Bluebird, be my salvation.

View File

@ -3,7 +3,6 @@ FROM node:20-alpine AS node_build
WORKDIR /src WORKDIR /src
COPY . . COPY . .
WORKDIR /src/pkg/web WORKDIR /src/pkg/web
RUN apk update && apk add git
RUN npm ci && npm run build RUN npm ci && npm run build
# Go application # Go application