Skip to content

Commit

Permalink
build: publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Nov 30, 2023
1 parent 9e9234f commit b25ec09
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 17 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion codapi.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b25ec09

Please sign in to comment.