build: publish workflow
This commit is contained in:
32
.github/workflows/publish.yml
vendored
Normal file
32
.github/workflows/publish.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: "stable"
|
||||
|
||||
- name: Install dependencies
|
||||
run: go get .
|
||||
|
||||
- name: Release and publish
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
17
.goreleaser.yaml
Normal file
17
.goreleaser.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
main: ./cmd/main.go
|
||||
|
||||
archives:
|
||||
- files:
|
||||
- "*.json"
|
||||
- images/*
|
||||
- codapi.service
|
||||
- LICENSE
|
||||
@@ -6,7 +6,7 @@ After=network.target
|
||||
Type=simple
|
||||
User=codapi
|
||||
WorkingDirectory=/opt/codapi
|
||||
ExecStart=/opt/codapi/build/codapi
|
||||
ExecStart=/opt/codapi/codapi
|
||||
Restart=on-failure
|
||||
StandardOutput=file:/opt/codapi/codapi.log
|
||||
StandardError=file:/opt/codapi/codapi.log
|
||||
|
||||
Reference in New Issue
Block a user