2 Commits

Author SHA1 Message Date
30f4ebbd6d fix paths
All checks were successful
Build and Release / build-and-release (386, linux, linux-386) (push) Successful in 32s
Build and Release / build-and-release (386, windows, windows-386) (push) Successful in 33s
Build and Release / build-and-release (amd64, linux, linux-amd64) (push) Successful in 37s
Build and Release / build-and-release (amd64, windows, windows-amd64) (push) Successful in 38s
Build and Release / build-and-release (arm, 7, linux, linux-armv7) (push) Successful in 42s
Build and Release / build-and-release (arm64, linux, linux-arm64) (push) Successful in 42s
Build and Release / build-and-release (ppc64le, linux, linux-ppc64le) (push) Successful in 49s
2025-12-23 15:39:01 +01:00
17a0346aa8 update buildflow
Some checks failed
Build and Release / build-and-release (386, linux, linux-386) (push) Failing after 3s
Build and Release / build-and-release (386, windows, windows-386) (push) Failing after 3s
Build and Release / build-and-release (amd64, linux, linux-amd64) (push) Failing after 4s
Build and Release / build-and-release (amd64, windows, windows-amd64) (push) Failing after 3s
Build and Release / build-and-release (arm, 7, linux, linux-armv7) (push) Failing after 3s
Build and Release / build-and-release (arm64, linux, linux-arm64) (push) Failing after 4s
Build and Release / build-and-release (ppc64le, linux, linux-ppc64le) (push) Failing after 3s
2025-12-23 15:26:00 +01:00

View File

@@ -6,7 +6,7 @@ on:
- 'v*' - 'v*'
jobs: jobs:
build: build-and-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@@ -65,68 +65,41 @@ jobs:
fi fi
go build -ldflags "-X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME}" \ go build -ldflags "-X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME}" \
-o bin/${OUTPUT_NAME} ./cmd/safelineApi -o bin/${OUTPUT_NAME} ./cmd/safelineApi
echo "BINARY_PATH=bin/${OUTPUT_NAME}" >> $GITHUB_ENV
echo "BINARY_NAME=${OUTPUT_NAME}" >> $GITHUB_ENV echo "BINARY_NAME=${OUTPUT_NAME}" >> $GITHUB_ENV
- name: Create release assets directory - name: Create or Update Release
run: | run: |
mkdir -p release-assets VERSION="${{ steps.version.outputs.VERSION }}"
cp ${{ env.BINARY_PATH }} release-assets/ REPO="${{ gitea.repository }}"
SERVER="${{ gitea.server_url }}"
TOKEN="${{ secrets.GITEA_TOKEN }}"
- name: Upload artifacts # Try to create release (ignore error if already exists)
uses: actions/upload-artifact@v4 curl -X POST "${SERVER}/api/v1/repos/${REPO}/releases" \
with: -H "Authorization: token ${TOKEN}" \
name: ${{ matrix.name }} -H "Content-Type: application/json" \
path: release-assets/${{ env.BINARY_NAME }} -d '{
retention-days: 1 "tag_name": "'${VERSION}'",
"target_commitish": "main",
"name": "Release '${VERSION}'",
"body": "# SafelineAPI '${VERSION}'\n\n## Available Downloads\n\n### Linux\n- **amd64**: safelineApi-linux-amd64\n- **ARM64**: safelineApi-linux-arm64\n- **ARMv7**: safelineApi-linux-armv7\n- **386**: safelineApi-linux-386\n- **PowerPC 64LE**: safelineApi-linux-ppc64le\n\n### Windows\n- **amd64**: safelineApi-windows-amd64.exe\n- **386**: safelineApi-windows-386.exe",
"draft": false,
"prerelease": false
}' || true
release: - name: Upload Binary Asset
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Flatten artifacts
run: | run: |
mkdir -p final-release VERSION="${{ steps.version.outputs.VERSION }}"
find release-artifacts -type f -exec mv {} final-release/ \; REPO="${{ gitea.repository }}"
ls -la final-release/ SERVER="${{ gitea.server_url }}"
TOKEN="${{ secrets.GITEA_TOKEN }}"
BINARY="${{ env.BINARY_NAME }}"
- name: Create Release # Get release ID
uses: gitea-github-actions/actions/gitea-release@main RELEASE_ID=$(curl -s "${SERVER}/api/v1/repos/${REPO}/releases/tags/${VERSION}" \
with: -H "Authorization: token ${TOKEN}" | grep '"id"' | head -1 | grep -o '[0-9]*')
files: final-release/*
draft: false
prerelease: false
title: Release ${{ steps.version.outputs.VERSION }}
body: |
# SafelineAPI ${{ steps.version.outputs.VERSION }}
## Available Downloads # Upload the binary
curl -X POST "${SERVER}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \
### Linux -H "Authorization: token ${TOKEN}" \
- **amd64**: safelineApi-linux-amd64 -F "attachment=@bin/${BINARY}" || true
- **ARM64**: safelineApi-linux-arm64
- **ARMv7**: safelineApi-linux-armv7
- **386**: safelineApi-linux-386
- **PowerPC 64LE**: safelineApi-linux-ppc64le
### Windows
- **amd64**: safelineApi-windows-amd64.exe
- **386**: safelineApi-windows-386.exe
Built at: ${{ github.event.head_commit.timestamp }}
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_SERVER: ${{ gitea.server_url }}