This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
name: CD - BanForge Release
|
||||
|
||||
on:
|
||||
@@ -11,7 +10,34 @@ permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Create Release
|
||||
env:
|
||||
TOKEN: ${{ secrets.TOKEN }}
|
||||
run: |
|
||||
TAG="${{ gitea.ref_name }}"
|
||||
REPO="${{ gitea.repository }}"
|
||||
SERVER="${{ gitea.server_url }}"
|
||||
|
||||
curl -X POST \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"tag_name": "'$TAG'",
|
||||
"name": "Release '$TAG'",
|
||||
"body": "# BanForge '$TAG'\n\nIntrusion Prevention System",
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}' \
|
||||
"$SERVER/api/v1/repos/$REPO/releases"
|
||||
|
||||
build:
|
||||
needs: release
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@@ -48,22 +74,9 @@ jobs:
|
||||
REPO="${{ gitea.repository }}"
|
||||
SERVER="${{ gitea.server_url }}"
|
||||
|
||||
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
||||
curl -X POST \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"tag_name": "'$TAG'",
|
||||
"name": "Release '$TAG'",
|
||||
"body": "# BanForge '$TAG'\n\nIntrusion Prevention System",
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}' \
|
||||
"$SERVER/api/v1/repos/$REPO/releases" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
curl -X POST \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary "@banforge-${{ matrix.goos }}-${{ matrix.arch }}" \
|
||||
"$SERVER/api/v1/repos/$REPO/releases/tags/$TAG/assets?name=banforge-${{ matrix.goos }}-${{ matrix.arch }}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user