修复自动Release工作流:GitHub用标准action,Gitea用专用release-action
Auto Release / build-and-release (push) Has been cancelled
Auto Release / build-and-release (push) Has been cancelled
This commit is contained in:
@@ -22,23 +22,11 @@ jobs:
|
|||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B clean package -DskipTests
|
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
|
- name: Create Release with JAR
|
||||||
uses: softprops/action-gh-release@v2
|
uses: gitea.com/actions/release-action@main
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.version.outputs.tag }}
|
tag_name: build-${{ gitea.run_number }}
|
||||||
name: ${{ steps.version.outputs.name }}
|
name: Build #${{ gitea.run_number }}
|
||||||
files: target/Sdf1_login.jar
|
files: |
|
||||||
generate_release_notes: true
|
target/Sdf1_login.jar
|
||||||
make_latest: true
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|||||||
@@ -22,23 +22,27 @@ jobs:
|
|||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B clean package -DskipTests
|
run: mvn -B clean package -DskipTests
|
||||||
|
|
||||||
- name: Get version info
|
- name: Upload JAR artifact
|
||||||
id: version
|
uses: actions/upload-artifact@v4
|
||||||
run: |
|
with:
|
||||||
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)
|
name: Sdf1_login
|
||||||
TIMESTAMP=$(date -u '+%Y%m%d-%H%M%S')
|
path: target/Sdf1_login.jar
|
||||||
echo "tag=build-${TIMESTAMP}-${SHORT_SHA}" >> $GITHUB_OUTPUT
|
|
||||||
echo "name=Build ${TIMESTAMP} (${SHORT_SHA})" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Delete old build tag if exists
|
release:
|
||||||
continue-on-error: true
|
needs: build-and-release
|
||||||
run: git push --delete origin ${{ steps.version.outputs.tag }} 2>/dev/null || true
|
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
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.version.outputs.tag }}
|
tag_name: build-${{ github.run_number }}
|
||||||
name: ${{ steps.version.outputs.name }}
|
name: Build #${{ github.run_number }}
|
||||||
files: target/Sdf1_login.jar
|
files: Sdf1_login.jar
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
make_latest: true
|
|
||||||
|
|||||||
Reference in New Issue
Block a user