Static Verzeichnis in Build-Parameter hinzugefügt
Some checks failed
release-tag / release-image (push) Successful in 1m32s
build-binaries / build (, amd64, linux) (push) Successful in 10m4s
build-binaries / build (, arm, 7, linux) (push) Successful in 10m3s
build-binaries / build (, arm64, linux) (push) Successful in 10m3s
build-binaries / build (.exe, amd64, windows) (push) Has started running
build-binaries / release (push) Has been cancelled
Some checks failed
release-tag / release-image (push) Successful in 1m32s
build-binaries / build (, amd64, linux) (push) Successful in 10m4s
build-binaries / build (, arm, 7, linux) (push) Successful in 10m3s
build-binaries / build (, arm64, linux) (push) Successful in 10m3s
build-binaries / build (.exe, amd64, windows) (push) Has started running
build-binaries / release (push) Has been cancelled
This commit is contained in:
@@ -1,15 +1,18 @@
|
|||||||
# Git(tea) Actions workflow: Build and publish standalone binaries
|
# Git(tea) Actions workflow: Build and publish standalone binaries **plus** bundled `static/` assets
|
||||||
# ────────────────────────────────────────────────────────────────────
|
# ────────────────────────────────────────────────────────────────────
|
||||||
# ✧ Builds the Go‑based WoL server for four targets
|
# ✧ Builds the Go‑based WoL server for four targets **and** packt das Verzeichnis
|
||||||
|
# `static` zusammen mit der Binary, sodass es relativ zur ausführbaren Datei
|
||||||
|
# liegt (wichtig für die eingebauten Bootstrap‑Assets & favicon).
|
||||||
|
#
|
||||||
# • linux/amd64 → wol-server-linux-amd64.tar.gz
|
# • linux/amd64 → wol-server-linux-amd64.tar.gz
|
||||||
# • linux/arm64 → wol-server-linux-arm64.tar.gz (Raspberry Pi 4/5, 64‑bit OS)
|
# • linux/arm64 → wol-server-linux-arm64.tar.gz
|
||||||
# • linux/arm/v7 → wol-server-linux-armv7.tar.gz (Raspberry Pi 2/3, 32‑bit OS)
|
# • linux/arm/v7 → wol-server-linux-armv7.tar.gz
|
||||||
# • windows/amd64 → wol-server-windows-amd64.zip
|
# • windows/amd64 → wol-server-windows-amd64.zip
|
||||||
# ✧ Uploads artifacts to the workflow and, on tag push (vX.Y.Z),
|
#
|
||||||
# attaches them to a GitHub/Gitea release.
|
# ✧ Artefakte landen im Workflow und – bei Tag‑Push (vX.Y.Z) – als Release‑Assets.
|
||||||
#
|
#
|
||||||
# Secrets/variables:
|
# Secrets/variables:
|
||||||
# GITEA_TOKEN – optional, only needed if default token lacks release perms.
|
# GITEA_TOKEN – optional, falls default token keine Release‑Rechte hat.
|
||||||
# ────────────────────────────────────────────────────────────────────
|
# ────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
name: build-binaries
|
name: build-binaries
|
||||||
@@ -29,10 +32,10 @@ jobs:
|
|||||||
- goos: linux
|
- goos: linux
|
||||||
goarch: amd64
|
goarch: amd64
|
||||||
ext: ""
|
ext: ""
|
||||||
- goos: linux # Raspberry Pi (64‑bit)
|
- goos: linux
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
ext: ""
|
ext: ""
|
||||||
- goos: linux # Raspberry Pi (32‑bit, armv7)
|
- goos: linux
|
||||||
goarch: arm
|
goarch: arm
|
||||||
goarm: "7"
|
goarm: "7"
|
||||||
ext: ""
|
ext: ""
|
||||||
@@ -58,37 +61,41 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
mkdir -p dist
|
mkdir -p dist/package
|
||||||
if [ -n "${{ matrix.goarm }}" ]; then export GOARM=${{ matrix.goarm }}; fi
|
if [ -n "${{ matrix.goarm }}" ]; then export GOARM=${{ matrix.goarm }}; fi
|
||||||
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -trimpath -ldflags "-s -w" \
|
CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -trimpath -ldflags "-s -w" \
|
||||||
-o "dist/${BINARY_NAME}-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goarm && format('v{0}', matrix.goarm) || '' }}${{ matrix.ext }}" .
|
-o "dist/package/${BINARY_NAME}${{ matrix.ext }}" .
|
||||||
|
# Assets: statisches Verzeichnis beilegen
|
||||||
|
cp -r static dist/package/
|
||||||
|
|
||||||
- name: Package archive
|
- name: Package archive with static assets
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
cd dist
|
cd dist
|
||||||
if [ "${{ matrix.goos }}" == "windows" ]; then
|
if [ "${{ matrix.goos }}" == "windows" ]; then
|
||||||
ZIP_NAME="${BINARY_NAME}-windows-amd64.zip"
|
ZIP_NAME="${BINARY_NAME}-windows-amd64.zip"
|
||||||
zip "$ZIP_NAME" "${BINARY_NAME}-windows-amd64.exe"
|
(cd package && zip -r "../$ZIP_NAME" .)
|
||||||
rm "${BINARY_NAME}-windows-amd64.exe"
|
|
||||||
else
|
else
|
||||||
ARCH_SUFFIX="${{ matrix.goarch }}"
|
ARCH_SUFFIX="${{ matrix.goarch }}"
|
||||||
if [ "${{ matrix.goarch }}" == "arm" ]; then ARCH_SUFFIX="armv${{ matrix.goarm }}"; fi
|
if [ "${{ matrix.goarch }}" == "arm" ]; then ARCH_SUFFIX="armv${{ matrix.goarm }}"; fi
|
||||||
TAR_NAME="${BINARY_NAME}-${{ matrix.goos }}-${ARCH_SUFFIX}.tar.gz"
|
TAR_NAME="${BINARY_NAME}-${{ matrix.goos }}-${ARCH_SUFFIX}.tar.gz"
|
||||||
tar -czf "$TAR_NAME" "${BINARY_NAME}-${{ matrix.goos }}-${ARCH_SUFFIX}"
|
tar -czf "$TAR_NAME" -C package .
|
||||||
rm "${BINARY_NAME}-${{ matrix.goos }}-${ARCH_SUFFIX}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload workflow artifact
|
- name: Upload workflow artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goarm && format('v{0}', matrix.goarm) || '' }}
|
name: ${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goarm && format('v{0}', matrix.goarm) || '' }}
|
||||||
path: |
|
path: dist/*.tar.gz
|
||||||
dist/*.zip
|
if-no-files-found: ignore
|
||||||
dist/*.tar.gz
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: windows-amd64
|
||||||
|
path: dist/*.zip
|
||||||
|
if-no-files-found: ignore
|
||||||
|
|
||||||
# Optional release step for tag pushes
|
# Release Schritt für Tag‑Pushes
|
||||||
release:
|
release:
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
needs: build
|
needs: build
|
||||||
@@ -97,7 +104,7 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download build artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
Reference in New Issue
Block a user