Skip to content

Commit

Permalink
added workflow for GH and GHCR releases
Browse files Browse the repository at this point in the history
  • Loading branch information
SHildebrandt committed May 23, 2024
1 parent f5c985a commit 38ed076
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.1
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
env GOOS=darwin GOARCH=arm64 go build -ldflags "-w -s" -o logicng-service-macos-arm main.go
env GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s" -o logicng-service-macos-amd main.go
env GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o logicng-service-linux main.go
env GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o logicng-service-win.exe main.go
- name: Build and Push Docker Image
run: |
docker build . -t ghcr.io/booleworks/logicng-service:${{ github.ref }}
docker push ghcr.io/booleworks/logicng-service:${{ github.ref }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
logicng-service-macos-arm
logicng-service-macos-amd
logicng-service-linux
logicng-service-win.exe
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*.swp

# build
logicng-service
logicng-service*

# docs
docs/
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine:latest

ENV TIMEOUT 5s

COPY logicng-service-linux /opt/logicng-service

EXPOSE 8080
CMD /opt/logicng-service --timeout $TIMEOUT

0 comments on commit 38ed076

Please sign in to comment.