3 Commits

Author SHA1 Message Date
3ec52f2aea fix release numbers
All checks were successful
Build and Release / build-and-release (386, linux, linux-386) (push) Successful in 40s
Build and Release / build-and-release (386, windows, windows-386) (push) Successful in 37s
Build and Release / build-and-release (amd64, linux, linux-amd64) (push) Successful in 40s
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 37s
Build and Release / build-and-release (arm64, linux, linux-arm64) (push) Successful in 38s
Build and Release / build-and-release (ppc64le, linux, linux-ppc64le) (push) Successful in 38s
2025-12-23 16:34:55 +01:00
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,58 @@ 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 Release (first run only)
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 }}"
# Check if release exists
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "${SERVER}/api/v1/repos/${REPO}/releases/tags/${VERSION}" \
-H "Authorization: token ${TOKEN}")
if [ "$RESPONSE" = "404" ]; then
# Create release if it doesn't exist
curl -X POST "${SERVER}/api/v1/repos/${REPO}/releases" \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'${VERSION}'",
"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
}'
fi
echo "Release checked/created"
- name: Upload artifacts - name: Upload Binary Asset
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: release-assets/${{ env.BINARY_NAME }}
retention-days: 1
release:
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 }}"
- name: Create Release BINARY="${{ env.BINARY_NAME }}"
uses: gitea-github-actions/actions/gitea-release@main
with: # Get release data
files: final-release/* RELEASE_DATA=$(curl -s "${SERVER}/api/v1/repos/${REPO}/releases/tags/${VERSION}" \
draft: false -H "Authorization: token ${TOKEN}")
prerelease: false
title: Release ${{ steps.version.outputs.VERSION }} RELEASE_ID=$(echo "$RELEASE_DATA" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
body: |
# SafelineAPI ${{ steps.version.outputs.VERSION }} if [ -z "$RELEASE_ID" ]; then
echo "Failed to get release ID"
## Available Downloads echo "$RELEASE_DATA"
exit 1
### Linux fi
- **amd64**: safelineApi-linux-amd64
- **ARM64**: safelineApi-linux-arm64 echo "Uploading $BINARY to release $RELEASE_ID"
- **ARMv7**: safelineApi-linux-armv7
- **386**: safelineApi-linux-386 # Upload the binary
- **PowerPC 64LE**: safelineApi-linux-ppc64le curl -X POST "${SERVER}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \
-H "Authorization: token ${TOKEN}" \
### Windows -F "attachment=@bin/${BINARY}"
- **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 }}