Anpassungen und Release-Optionen
Some checks failed
release-tag / release-image (push) Successful in 1m25s
build‑binaries / build (, linux) (push) Successful in 11m29s
build‑binaries / release (push) Has been cancelled
build‑binaries / build (.exe, windows) (push) Has been cancelled

This commit is contained in:
2025-08-05 19:38:07 +02:00
parent 9e4729fbc2
commit bcd5ccd0cf
2 changed files with 121 additions and 17 deletions

View File

@@ -0,0 +1,100 @@
# Git(tea) Actions workflow: Build and publish standalone binaries
# ────────────────────────────────────────────────────────────────────
# ✧ Builds the Gobased WoL server for
# • linux/amd64 → wol-server-linux-amd64.tar.gz
# • windows/amd64 → wol-server-windows-amd64.zip
# ✧ Attaches the archives as workflow artifacts **and** to a tagbased release
# (vX.Y.Z). If the push is to main (without tag), the artifacts are still
# available in the workflow run.
#
# Prerequisites (⇔ repository secrets / variables):
# • GITEA_TOKEN API token with repo write permissions (for release upload)
# (not needed if your Gitea instance autoauthenticates Actions)
# ────────────────────────────────────────────────────────────────────
name: buildbinaries
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
jobs:
build:
runs-on: ubuntu-fast
strategy:
matrix:
include:
- goos: linux # ➜ .tar.gz
ext: ""
- goos: windows # ➜ .zip (adds .exe)
ext: ".exe"
env:
GO_VERSION: "1.22"
BINARY_NAME: wol-server
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Build ${{ matrix.goos }}/amd64
shell: bash
run: |
mkdir -p dist
GOOS=${{ matrix.goos }} GOARCH=amd64 go build -trimpath -ldflags "-s -w" \
-o "dist/${BINARY_NAME}-${{ matrix.goos }}-amd64${{ matrix.ext }}" .
- name: Package archive
shell: bash
run: |
cd dist
if [ "${{ matrix.goos }}" == "windows" ]; then
zip "${BINARY_NAME}-windows-amd64.zip" "${BINARY_NAME}-windows-amd64.exe"
rm "${BINARY_NAME}-windows-amd64.exe"
else
tar -czf "${BINARY_NAME}-linux-amd64.tar.gz" "${BINARY_NAME}-linux-amd64"
rm "${BINARY_NAME}-linux-amd64"
fi
- name: Upload workflow artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.goos }}-amd64
path: |
dist/*.zip
dist/*.tar.gz
# Optional: publish release assets if this is a tag push
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-fast
permissions:
contents: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
path: ./dist
- name: Create / Update release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN || github.token }}
with:
name: "Release ${{ github.ref_name }}"
tag_name: ${{ github.ref_name }}
draft: false
prerelease: false
files: |
dist/**/wol-server-*.zip
dist/**/wol-server-*.tar.gz

View File

@@ -2,31 +2,35 @@ services:
api:
image: git.send.nrw/sendnrw/edge-wol:latest
container_name: edgewol
restart: unless-stopped
volumes:
- /docker/edgewol/machines.json:/data/machines.json
labels:
- traefik.enable=true
- traefik.http.routers.edgewol.rule=Host(`edgewol.b1tsblog.org`)
- traefik.http.services.edgewol.loadbalancer.server.port=8080
- traefik.http.routers.edgewol.entrypoints=websecure
- traefik.http.routers.edgewol.tls=true
- traefik.http.routers.edgewol.tls.certresolver=letsencrypt
- traefik.http.middlewares.edgewol-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.edgewol-redirect.redirectscheme.permanent=true
- traefik.http.routers.edgewol0.rule=Host(`edgewol.b1tsblog.org`)
- traefik.http.routers.edgewol0.entrypoints=web
- traefik.http.routers.edgewol0.middlewares=edgewol-redirect
- traefik.protocol=http
networks:
- traefik-net
#labels:
#- traefik.enable=true
#- traefik.http.routers.edgewol.rule=Host(`edgewol.b1tsblog.org`)
#- traefik.http.services.edgewol.loadbalancer.server.port=8080
#- traefik.http.routers.edgewol.entrypoints=websecure
#- traefik.http.routers.edgewol.tls=true
#- traefik.http.routers.edgewol.tls.certresolver=letsencrypt
#- traefik.http.middlewares.edgewol-redirect.redirectscheme.scheme=https
#- traefik.http.middlewares.edgewol-redirect.redirectscheme.permanent=true
#- traefik.http.routers.edgewol0.rule=Host(`edgewol.b1tsblog.org`)
#- traefik.http.routers.edgewol0.entrypoints=web
#- traefik.http.routers.edgewol0.middlewares=edgewol-redirect
#- traefik.protocol=http
network_mode: host
#networks:
#- traefik-net
environment:
# HIER BEARBEITEN
EW_USERNAME: groot
EW_PASSWORD: ""
EW_PRODUCTIVE: true
EW_DB: /data/machines.json
TZ: Europe/Berlin
# Sollten Ports extern verfügbar gemacht werden müssen (nicht empfohlen)
#ports:
#- "8080:8080" # <host>:<container>
ports:
- "8080:8080" # <host>:<container>
restart: unless-stopped
# Newt-Client für eine Pangolin-Integration
#newt: