Public Access
fix: workflow YAML — remove duplicate push key, use BOT_TOKEN secret
This commit is contained in:
+13
-20
@@ -3,11 +3,10 @@ name: Action Gateway CI/CD
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
push:
|
|
||||||
tags:
|
tags:
|
||||||
- 'release/*'
|
- 'release/*'
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
@@ -49,28 +48,22 @@ jobs:
|
|||||||
- name: Build release binary
|
- name: Build release binary
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
- name: Extract tag
|
|
||||||
id: tag
|
|
||||||
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Create Gitea release with binary
|
- name: Create Gitea release with binary
|
||||||
run: |
|
run: |
|
||||||
RELEASE=$(curl -s -X POST "$GITEA_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/releases" \
|
TAG="${GITHUB_REF#refs/tags/}"
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
RELEASE=$(curl -s -X POST "https://git.dominat.us/api/v1/repos/clawbot/action-gateway/releases" \
|
||||||
|
-H "Authorization: token ${{ secrets.BOT_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{
|
-d "{
|
||||||
\"tag_name\": \"${{ steps.tag.outputs.TAG }}\",
|
\"tag_name\": \"$TAG\",
|
||||||
\"name\": \"Action Gateway ${{ steps.tag.outputs.TAG }}\",
|
\"name\": \"Action Gateway $TAG\",
|
||||||
\"body\": \"Automated release\\n\\nCommit: ${{ github.sha }}\",
|
\"body\": \"Automated release\n\nCommit: ${{ github.sha }}\",
|
||||||
\"draft\": false
|
\"draft\": false
|
||||||
}")
|
}")
|
||||||
RELEASE_ID=$(echo $RELEASE | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
RELEASE_ID=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
|
|
||||||
curl -s -X POST "$GITEA_URL/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/releases/$RELEASE_ID/assets" \
|
curl -s -X POST "https://git.dominat.us/api/v1/repos/clawbot/action-gateway/releases/$RELEASE_ID/assets" \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token ${{ secrets.BOT_TOKEN }}" \
|
||||||
-F "attachment=@target/release/action-gateway;filename=action-gateway-linux-amd64"
|
-F "attachment=@target/release/action-gateway;filename=action-gateway-linux-amd64"
|
||||||
env:
|
|
||||||
GITEA_URL: https://git.dominat.us
|
echo "Release $TAG created: $RELEASE_ID"
|
||||||
GITEA_OWNER: clawbot
|
|
||||||
GITEA_REPO: action-gateway
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user