From 104286a66efe14e2982423b23ba8316123fad45c Mon Sep 17 00:00:00 2001 From: youpaishidifu Date: Sat, 18 Jul 2026 21:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8Release?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=9AGitHub=E7=94=A8=E6=A0=87?= =?UTF-8?q?=E5=87=86action=EF=BC=8CGitea=E7=94=A8=E4=B8=93=E7=94=A8release?= =?UTF-8?q?-action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release.yml | 24 ++++++------------------ .github/workflows/release.yml | 34 +++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index c67b645..45fb530 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -22,23 +22,11 @@ jobs: - name: Build with Maven run: mvn -B clean package -DskipTests - - name: Get version info - id: version - run: | - SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7) - TIMESTAMP=$(date -u '+%Y%m%d-%H%M%S') - echo "tag=build-${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT - echo "name=Build ${TIMESTAMP} (${SHORT_SHA})" >> $GITHUB_OUTPUT - - - name: Delete old build tag if exists - continue-on-error: true - run: git push --delete origin ${{ steps.version.outputs.tag }} 2>/dev/null || true - - name: Create Release with JAR - uses: softprops/action-gh-release@v2 + uses: gitea.com/actions/release-action@main with: - tag_name: ${{ steps.version.outputs.tag }} - name: ${{ steps.version.outputs.name }} - files: target/Sdf1_login.jar - generate_release_notes: true - make_latest: true + tag_name: build-${{ gitea.run_number }} + name: Build #${{ gitea.run_number }} + files: | + target/Sdf1_login.jar + token: ${{ secrets.GITEA_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c67b645..5ed3034 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,23 +22,27 @@ jobs: - name: Build with Maven run: mvn -B clean package -DskipTests - - name: Get version info - id: version - run: | - SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7) - TIMESTAMP=$(date -u '+%Y%m%d-%H%M%S') - echo "tag=build-${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT - echo "name=Build ${TIMESTAMP} (${SHORT_SHA})" >> $GITHUB_OUTPUT + - name: Upload JAR artifact + uses: actions/upload-artifact@v4 + with: + name: Sdf1_login + path: target/Sdf1_login.jar - - name: Delete old build tag if exists - continue-on-error: true - run: git push --delete origin ${{ steps.version.outputs.tag }} 2>/dev/null || true + release: + needs: build-and-release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download JAR artifact + uses: actions/download-artifact@v4 + with: + name: Sdf1_login - - name: Create Release with JAR + - name: Create Release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ steps.version.outputs.tag }} - name: ${{ steps.version.outputs.name }} - files: target/Sdf1_login.jar + tag_name: build-${{ github.run_number }} + name: Build #${{ github.run_number }} + files: Sdf1_login.jar generate_release_notes: true - make_latest: true