.gitea/workflows/linux_arm64_docker-release.yaml aktualisiert
Some checks failed
Build Docker Linux ARM64 Release / build-docker-linux-arm64-release (push) Failing after 32s
Some checks failed
Build Docker Linux ARM64 Release / build-docker-linux-arm64-release (push) Failing after 32s
This commit is contained in:
@@ -4,7 +4,6 @@ run-name: Release-Docker-Linux-ARM64
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main", "master" ]
|
branches: [ "main", "master" ]
|
||||||
tags: [ "v*" ] # Reagiert auf v1.0.0, v2.1.3-beta.1, etc.
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker-linux-arm64-release:
|
build-docker-linux-arm64-release:
|
||||||
@@ -16,28 +15,31 @@ jobs:
|
|||||||
- name: Clone the repository
|
- name: Clone the repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0 # Zwingend notwendig für go-semantic-release
|
||||||
|
|
||||||
# 1. Namen in Kleinschreibung konvertieren (für Docker Registry nötig)
|
# 1. Nächste Version berechnen
|
||||||
- name: Prepare Repo Name
|
- name: Determine Next Version
|
||||||
run: echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
id: semantic_release
|
||||||
|
uses: go-semantic-release/action@v1
|
||||||
# 2. Extraktion der Docker Metadaten (SemVer Magie)
|
|
||||||
- name: Docker metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
with:
|
||||||
images: gitea.penry.de/${{ env.REPO_LC }}
|
# Wir nutzen das Gitea Token für die Authentifizierung
|
||||||
# Hier definieren wir, wie Tags generiert werden:
|
github-token: ${{ secrets.GITEA_TOKEN }}
|
||||||
tags: |
|
# Da wir auf Gitea sind, müssen wir die Gitea-API angeben
|
||||||
# Wenn ein Tag v1.2.3 gepusht wird:
|
allow-initial-development-versions: true
|
||||||
type=semver,pattern={{version}}
|
force-bump-patch-version: true
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
# Wir wollen das Release erst am Ende machen, hier nur die Version holen
|
||||||
type=semver,pattern={{major}}
|
dry-run: true
|
||||||
# Wenn auf main gepusht wird, erstelle 'latest'
|
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
# 2. Vorbereitung Namen
|
||||||
# Optional: Für jeden Commit auf main einen 'edge' Tag
|
- name: Prepare Variables
|
||||||
type=edge,branch=main
|
run: |
|
||||||
|
echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
|
||||||
|
# Wenn go-semantic-release eine neue Version findet, nimm diese, sonst 'latest'
|
||||||
|
if [ -z "${{ steps.semantic_release.outputs.version }}" ]; then
|
||||||
|
echo "NEXT_VERSION=latest" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "NEXT_VERSION=${{ steps.semantic_release.outputs.version }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Login to own image registry
|
- name: Login to own image registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@@ -51,29 +53,38 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: '10.0.x'
|
dotnet-version: '10.0.x'
|
||||||
|
|
||||||
# 3. Build mit den automatisch generierten Tags
|
# 3. Docker Build & Push (SemVer konform)
|
||||||
- name: Build and Push Linux ARM64 Docker Image
|
- name: Build and Push Docker Image
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/arm64
|
|
||||||
push: true
|
|
||||||
# Hier werden alle von 'meta' generierten Tags übergeben
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
# 4. Release Artefakt (nur bei echten Version-Tags)
|
|
||||||
- name: Export Image Tar
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
run: |
|
run: |
|
||||||
# Wir nehmen den präzisesten Tag aus den Metadaten für den Dateinamen
|
# Wir bauen immer 'latest' UND die neue Version (falls vorhanden)
|
||||||
VERSION=${{ steps.meta.outputs.version }}
|
TAG_LIST="-t gitea.penry.de/${{ env.REPO_LC }}:latest"
|
||||||
docker pull gitea.penry.de/${{ env.REPO_LC }}:$VERSION
|
if [ "${{ env.NEXT_VERSION }}" != "latest" ]; then
|
||||||
docker save -o couchlog-linux-arm64-$VERSION.tar gitea.penry.de/${{ env.REPO_LC }}:$VERSION
|
TAG_LIST="$TAG_LIST -t gitea.penry.de/${{ env.REPO_LC }}:${{ env.NEXT_VERSION }}"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Release
|
docker build $TAG_LIST \
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
--label "org.opencontainers.image.source=https://gitea.penry.de/${{ github.repository }}" \
|
||||||
|
.
|
||||||
|
|
||||||
|
docker push gitea.penry.de/${{ env.REPO_LC }} --all-tags
|
||||||
|
|
||||||
|
# 4. Das eigentliche Release in Gitea erstellen (nur wenn neue Version da ist)
|
||||||
|
- name: Execute Semantic Release
|
||||||
|
if: steps.semantic_release.outputs.version != ''
|
||||||
|
uses: go-semantic-release/action@v1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
# Hier wird jetzt der echte Git-Tag und das Gitea-Release erstellt
|
||||||
|
|
||||||
|
# 5. Image exportieren für Gitea Release Assets
|
||||||
|
- name: Export Image Tar
|
||||||
|
if: steps.semantic_release.outputs.version != ''
|
||||||
|
run: |
|
||||||
|
docker save -o couchlog-linux-arm64-${{ env.NEXT_VERSION }}.tar gitea.penry.de/${{ env.REPO_LC }}:${{ env.NEXT_VERSION }}
|
||||||
|
|
||||||
|
- name: Upload Release Asset
|
||||||
|
if: steps.semantic_release.outputs.version != ''
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
files: |-
|
files: |-
|
||||||
couchlog-linux-arm64-${{ steps.meta.outputs.version }}.tar
|
couchlog-linux-arm64-${{ env.NEXT_VERSION }}.tar
|
||||||
Reference in New Issue
Block a user