Merge branch 'main' of https://git.ypshidifu.cn/youpaishidifu/Sdf1_login
This commit is contained in:
@@ -6,17 +6,20 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: self-hosted
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Build with Maven
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/java-25-openjdk
|
||||
PATH: "${JAVA_HOME}/bin:${PATH}"
|
||||
run: mvn -B clean package -DskipTests
|
||||
|
||||
- name: Verify JAR
|
||||
@@ -29,36 +32,6 @@ jobs:
|
||||
set -e
|
||||
VERSION=$(grep "^version:" src/main/resources/plugin.yml | awk '{print $2}' | tr -d '\r\n ')
|
||||
TAG="v${VERSION}"
|
||||
BASE="${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}"
|
||||
echo "Version: ${VERSION}, Tag: ${TAG}"
|
||||
echo "Release creation would happen here"
|
||||
|
||||
echo "=== Checking existing tag ${TAG} ==="
|
||||
RESP=$(curl -s -w "\nHTTP_CODE:%{http_code}" -H "Authorization: token $GITEA_TOKEN" "${BASE}/releases/tags/${TAG}")
|
||||
HTTP_CODE=$(echo "$RESP" | grep -o "HTTP_CODE:[0-9]*" | cut -d: -f2)
|
||||
echo "Check tag HTTP: ${HTTP_CODE}"
|
||||
|
||||
if [ "$HTTP_CODE" = "200" ]; then
|
||||
OLD_ID=$(echo "$RESP" | head -1 | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
echo "Tag ${TAG} exists (release #${OLD_ID}), deleting..."
|
||||
curl -s -X DELETE -H "Authorization: token $GITEA_TOKEN" "${BASE}/releases/${OLD_ID}"
|
||||
curl -s -X DELETE -H "Authorization: token $GITEA_TOKEN" "${BASE}/tags/${TAG}"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
echo "=== Creating release ==="
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${BASE}/releases" \
|
||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":\"Auto release by Gitea Actions\"}"
|
||||
|
||||
echo "=== Uploading artifact ==="
|
||||
JAR=$(ls target/*.jar | head -1)
|
||||
UPLOAD_URL=$(curl -s -H "Authorization: token $GITEA_TOKEN" "${BASE}/releases/tags/${TAG}" | grep -o '"upload_url":[^,]*' | cut -d'"' -f4)
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/jar" \
|
||||
"${UPLOAD_URL}?name=$(basename ${JAR})" \
|
||||
--data-binary "@${JAR}"
|
||||
|
||||
echo "=== Release ${TAG} created successfully ==="
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
name: Simple Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Hello
|
||||
run: echo "Hello from Gitea Actions!"
|
||||
@@ -612,3 +612,12 @@ http-port=443
|
||||
- gitcode: [https://gitcode.com/ypsdf1/Sdf1_login](https://gitcode.com/ypsdf1/Sdf1_login)
|
||||
trigger
|
||||
# test
|
||||
fix: restore runner and action pipeline
|
||||
test: trigger action with restored runner Sun Sep 27 11:31:10 CST 2026
|
||||
test: runner working Sun Sep 27 11:50:11 CST 2026
|
||||
debug: Sun Sep 27 11:53:47 CST 2026
|
||||
test: Sun Sep 27 12:00:33 CST 2026
|
||||
test
|
||||
debug
|
||||
final test
|
||||
test
|
||||
|
||||
Reference in New Issue
Block a user